Prasanth Madhavan Prasanth Madhavan - 1 year ago 155
C++ Question

Sleep for milliseconds

I know the POSIX

function makes the program sleep for x seconds. Is there a function to make the program sleep for x milliseconds in C++?

Answer Source

Note that there is no standard C API for milliseconds, so (on Unix) you will have to settle for usleep, which accepts microseconds:

#include <unistd.h>

unsigned int microseconds;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download