Click to See Complete Forum and Search --> : thread sleep


preetham
October 29th, 2002, 06:31 PM
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.

cup
October 30th, 2002, 02:40 AM
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.

sgenie
November 6th, 2002, 09:35 PM
usleep()