NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Thread.Sleep (TimeSpan)

Suspends the current thread for a specified time.

[Visual Basic]
Overloads Public Shared Sub Sleep( _
   ByVal timeout As TimeSpan _
)
[C#]
public static void Sleep(
   TimeSpan timeout
);
[C++]
public: static void Sleep(
   TimeSpan timeout
);
[JScript]
public static function Sleep(
   timeout : TimeSpan
);

Parameters

timeout
The number of milliseconds for which the thread will be suspended.

Exceptions

Exception Type Condition
ArgumentException The timeout value is less than zero.
ThreadInterruptedException The thread is interrupted while sleeping.
SecurityException The caller does not have the appropriate SecurityPermission.

Remarks

If the timeout period is zero, this method forces the thread to give up the remainder of its time slice.

See Also

Thread Class | Thread Members | System.Threading Namespace | Thread.Sleep Overload List