Sleep The Sleep function suspends the execution of the current thread for a specified interval. VOID Sleep( DWORD dwMilliseconds // sleep time in milliseconds );
Parameters dwMilliseconds Specifies the time, in milliseconds, for which to suspend execution. A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there are no other threads of equal priority ready to run, the function returns immediately, and the thread continues execution. A value of INFINITE causes an infinite delay.
在VC中同样是Sleep,具体的定义看MSDN,如下:VOID Sleep( DWORD dwMilliseconds // sleep time in milliseconds );
如:Sleep(1000),就是等待1秒钟
The Sleep function suspends the execution of the current thread for a specified interval. VOID Sleep(
DWORD dwMilliseconds // sleep time in milliseconds
);
Parameters
dwMilliseconds
Specifies the time, in milliseconds, for which to suspend execution. A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there are no other threads of equal priority ready to run, the function returns immediately, and the thread continues execution. A value of INFINITE causes an infinite delay.
DWORD dwMilliseconds // sleep time in milliseconds
);
在主线程里小心使用,会dead lock!!