Click to See Complete Forum and Search --> : How to write a Delay(mseconds) function?


May 6th, 1999, 04:07 PM
How to write a function to delay for given number of miliseconds?
The function will be called intensively once the app starts. So cpu usage has to be considered.
Any hints? Thanks

May 6th, 1999, 04:40 PM
Use the Sleep() function. The following two lines of code will suspend execution for 300 milliseconds.

DWORD delay = 300; // Number of milliseconds to delay
Sleep(delay);