xref: /csrg-svn/lib/libc/gen/usleep.3 (revision 25789)
Copyright (c) 1980 Regents of the University of California.
All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.

@(#)@(#)usleep.3 6.1 (Berkeley) 01/09/86

USLEEP 3 ""
C 6
NAME
usleep - suspend execution for interval
SYNOPSIS
 usleep(useconds)  unsigned useconds; 
DESCRIPTION
The current process is suspended from execution for the number of microseconds specified by the argument. The actual suspension time may be an arbitrary amount longer because of other activity in the system.

The routine is implemented by setting an interval timer and pausing until it occurs. The previous state of this timer is saved and restored. If the sleep time exceeds the time to the expiration of the previous timer, the process sleeps only until the signal would have occurred, and the signal is sent 2 system clock ticks later. .sh BUGS This routine is expensive to use because it is implemented using setitimer (2) and does eight system calls each time it is invoked. It should be implemented using select (2).

"SEE ALSO"
setitimer(2), getitimer(2), sigpause(2), ualarm(3), sleep(3), alarm(3)