Mono Class Library: System.Threading.Thread Overview | Members

System.Threading.Thread.Sleep Method

Blocks the current thread for the specified number of milliseconds. [Edit]

public static void Sleep (int millisecondsTimeout)

Parameters

millisecondsTimeout
A int containing the number of milliseconds for which the thread is blocked. Specify zero to indicate that this thread should be suspended temporarily to allow other waiting threads to execute. Specify Timeout.Infinite to block the thread indefinitely. [Edit]

Exceptions

TypeReason
ArgumentOutOfRangeExceptionThe value of millisecondsTimeout is negative and is not equal to Timeout.Infinite . [Edit]

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 ThreadState.WaitSleepJoin. [Edit]

Requirements

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0