|
Overview |
|
|
|
Group |
|
|
|
Quick Info
Windows NT
| Yes
| Win95
| Yes
| Win32s
| Yes
| Import Library
| kernel32.lib
| Header File
| winbase.h
| Unicode
| No
| Platform Notes
| None
|
|
|
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.
Return Values
This function does not return a value.
Remarks
A thread can relinquish the remainder of its time slice by calling this
function with a sleep time of zero milliseconds.
You have to be careful when using Sleep and DDE. If a thread creates any windows, it must process messages. DDE sends
messages to all windows in the system. If you have a thread that uses a wait
function with no time-out interval, the system will deadlock. Therefore, if you
have a thread that creates windows, use MsgWaitForMultipleObjects or MsgWaitForMultipleObjectsEx, rather than Sleep.
See Also
MsgWaitForMultipleObjects, MsgWaitForMultipleObjectsEx, SleepEx
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps
Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|