SLEEP(3) BSD Programmer's Manual SLEEP(3)NAME
sleep, usleep - suspend process execution
SYNOPSIS
#include <unistd.h>
unsigned int
sleep(unsigned int seconds);
void
usleep(unsigned int microseconds);
DESCRIPTION
The sleep() function suspends execution of the calling process for
seconds of clock time, or until interrupted by a signal.
The usleep() function suspends execution of the calling process for
microseconds of clock time, or until interrupted by a signal.
System activity may lengthen the suspension.
RETURN VALUES
The sleep() function returns 0, or if interrupted before seconds, the
amount not slept (the requested time minus the time actually slept) in
seconds.
SEE ALSOselect(2), setitimer(2)COMPATIBILITY
Previous implementations of sleep() and usleep() re-suspended the process
if interrupted by a signal. This implementation has been changed to re-
turn in that case, to conform to IEEE Std1003.1-1988 (``POSIX'').
HISTORY
A usleep() function appeared in 4.3BSD.
A sleep() function appeared in Version 7 AT&T UNIX.
BSDI BSD/OS March 25, 1995 1