A "Delay()" function for c++ windows applications
This code stops your program in windows without causing it to "hang"
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
void Delay(DWORD nTimeMs)
{
MSG msg;
DWORD endTick;
endTick = GetTickCount() + nTimeMs;
while(GetTickCount() < endTick)
{
if(PeekMessage(&msg, NULL, 0, 0, TRUE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return;
}
Original Comments (3)
Recovered from Wayback Machine