Thread.Sleep Method (TimeSpan)
Suspends the current thread for the specified amount of time.
Assembly: mscorlib (in mscorlib.dll)
The amount of time for which the thread is suspended. If the value of the millisecondsTimeout argument is TimeSpan.Zero, the thread relinquishes the remainder of its time slice to any thread of equal priority that is ready to run. If there are no other threads of equal priority that are ready to run, execution of the current thread is not suspended.
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.
You can specify Timeout.InfiniteTimeSpan for the timeout parameter to suspend the thread indefinitely. However, we recommend that you use other System.Threading classes such as Mutex, Monitor, EventWaitHandle, or Semaphore instead to sychronize threads or manage resources.
This overload of Sleep uses the total number of whole milliseconds in timeout. Fractional milliseconds are discarded.
This method does not perform standard COM and SendMessage pumping.
Available since 1.1
Available since 2.0
Windows Phone Silverlight
Available since 7.0