usleep(3C) usleep(3C)
usleep - suspend execution for an interval
#include <unistd.h>
int usleep (useconds_t seconds);
The usleep() function suspends the current thread from execution for the
number of microseconds specified by the seconds argument. Because of
other activity, or because of the time spent in processing the call, the
actual suspension time may be longer than the amount of time specified.
The seconds argument must be less than 1,000,000. If the value of
seconds is 0, the call has no effect.
The usleep() function uses the high resolution sleep function:
nanosleep() to suspend execution of a thread.
Upon successful completion, a 0 value is returned. Otherwise, -1 is
returned and errno is set to indicate the error. If the time interval
specified is 1,000,000 or more microseconds, errno is set to EINVAL and
-1 is returned from usleep().
nanosleep(2).
PPPPaaaaggggeeee 1111 [ Back ]
|