Hi,
i am using C++ and pthreads. from what i understand, sleep() puts the thread to sleep in units of 1 second. what can i do if i need millisecond intervals.
Appreciate the help
Thanks,
Preetham.
Printable View
Hi,
i am using C++ and pthreads. from what i understand, sleep() puts the thread to sleep in units of 1 second. what can i do if i need millisecond intervals.
Appreciate the help
Thanks,
Preetham.
Try nanosleep.
sleep isn't reliable on some versions of Unix (eg Solaris 2.6) as it uses SIGALRM, which may also be used by the thread mechanism.
usleep()