Type Reason ArgumentOutOfRangeException The value of millisecondsTimeout is negative and is not equal to Timeout.Infinite .
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.
You can specify Timeout.Infinite for the millisecondsTimeout parameter to suspend the thread indefinitely. However, we recommend that you use other System.Threading classes such as System.Threading.Mutex, System.Threading.Monitor, System.Threading.EventWaitHandle, or System.Threading.Semaphore instead to sychronize threads or manage resources.
This method does not perform standard COM and SendMessage pumping.
If you need to sleep on a thread that has STAThreadAttribute, but you want to perform standard COM and SendMessage pumping, consider using one of the overloads of the erload:System.Threading.Thread.Join method that specifies a timeout interval.