usleep(3) CLIX usleep(3)
NAME
usleep - Suspends execution for an interval of time
LIBRARY
Berkeley Software Distribution (libbsd.a)
SYNOPSIS
void usleep(
unsigned useconds );
PARAMETERS
useconds Specifies the number of microseconds to suspend the execution
of the current process.
DESCRIPTION
The usleep() function suspends the current process from execution for the
number of microseconds specified by useconds. The actual suspension time
may be longer due to other system activity or the time spent in processing
the call.
This function is implemented by setting an interval timer and pausing
until the timer expires. The previous state of this timer is saved and
restored. If the interval timer is set more than once and the new sleep
time exceeds the time until the expiration of a previous timer, the
process sleeps only until the signal would have occurred. The signal is
sent a short time later.
The usleep() function uses setitimer() to set the interval timer. A
similar but less compatible function can be obtained with a single
select(); it would not restart after signals, but would not interfere with
other uses of setitimer().
RELATED INFORMATION
Functions: setitimer(2), getitimer(2), sigset(2), sleep(3), alarm(3)
2/94 - Intergraph Corporation 1