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.