Sleep for milliseconds?
I know the POSIX `sleep(x)` function makes the program sleep for x seconds. Is there a function to make the program sleep for x *milliseconds* in C++?
Inactive Tutor
answered 04/05/20
It's OS dependent......
I'm running Bloodshed Dev C++ on windows. The following code worked, so in MY CASE it's in unistd.h
//#ifdef _WIN32
//#include <Windows.h>
//#else
#include <unistd.h>
//#endif
int main()
{
sleep(7);
}
Still looking for help? Get the right answer, fast.
OR
Find an Online Tutor Now
Choose an expert and meet online.
No packages or subscriptions, pay only for the time you need.