There's a Windows function Sleep that takes, as its only parameter, an integer for the number of milliseconds to sleep.
try this:
void delay(unsigned int waitMilli){ unsigned int timeNow = clock(); while ( clock() - timeNow <= waitMilli );<p> cout << flush;//this not needed but it helps sometime with cout's <br>}
Hope it helps
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
There's a Windows function Sleep that takes, as its only parameter, an integer for the number of milliseconds to sleep.
try this:
void delay(unsigned int waitMilli)
{
unsigned int timeNow = clock();
while ( clock() - timeNow <= waitMilli );<p>
cout << flush;//this not needed but it helps sometime with cout's <br>
}
Hope it helps