Hi, how do I get the system to pause for a certain amount of milliseconds before moving onto the next command?
Hi, how do I get the system to pause for a certain amount of milliseconds before moving onto the next command?
/*START CODE BLOCK*/
#include <stdio.h>
#include <unistd.h>
int main()
{
printf("Starting delay.\n");
sleep(5);
printf("Ending delay.\n");
return 0;
}
/*END CODE BLOCK*/
this works in Linux, I don't know if windows will have the same header file. The sleep() function takes an unsigned int, and sleeps for that many SECONDS(sorry it's not milliseconds). Anyway, I hope it helps, if not I'd like to see what function does sleep for milliseconds. If anybody else knows, please post.
Ian (:
sleep() is stdlib.h in MSVC i think.
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.