Share via


Sleep Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Suspends the current thread for a specified time.

Namespace:  System.Threading
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Shared Sub Sleep ( _
    millisecondsTimeout As Integer _
)
public static void Sleep(
    int millisecondsTimeout
)
public:
static void Sleep(
    int millisecondsTimeout
)
static member Sleep : 
        millisecondsTimeout:int -> unit 
public static function Sleep(
    millisecondsTimeout : int
)

Parameters

  • millisecondsTimeout
    Type: System. . :: . .Int32
    The number of milliseconds for which the thread is blocked. Specify zero (0) to indicate that this thread should be suspended to allow other waiting threads to execute. Specify Infinite to block the thread indefinitely.

Remarks

The thread will not be scheduled for execution by the operating system for the amount of time specified. This method changes the state of the thread to include WaitSleepJoin.

This method does not perform standard COM and SendMessage pumping.

.NET Framework Security

See Also

Reference

Thread Class

System.Threading Namespace