I am trying to add a timed delay in a C++ program, and was wondering if anyone has any suggestions on what I can try or information I can look at?
I wish I had more
You can also use select(2) if you want microsecond precision (this works on platform that don't have usleep(3))
The following code will wait for 1.5 second:
#include #include #include ` int main() { struct timeval t; t.tv_sec = 1; t.tv_usec = 500000; select(0, NULL, NULL, NULL, &t); }
`