[Previous] [Next]

Sleeping

A thread can also tell the system that it does not want to be schedulable for a certain amount of time. This is accomplished by calling Sleep:

VOID Sleep(DWORD dwMilliseconds);

This function causes the thread to suspend itself until dwMilliseconds have elapsed. There are a few important things to notice about Sleep: