Blocks the current thread for a specified time.
- timeout
- A TimeSpan set to the amount of time for which the current thread will be blocked. Specify zero to indicate that this thread should be suspended temporarily to allow other waiting threads to execute. Specify Timeout.Infinite milliseconds to suspend the thread indefinitely.
Type Reason ArgumentOutOfRangeException The value of timeout is negative and is not equal to Timeout.Infinite milliseconds, or is greater than int.MaxValue milliseconds.
This method converts timeout to milliseconds, tests the validity of the converted value, and calls Thread.Sleep(int)(int).
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.
Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0