BSD 4_3 release
[unix-history] / usr / man / man3 / usleep.3
CommitLineData
cb026509
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
95f51977 5.\" @(#)@(#)usleep.3 6.3 (Berkeley) 5/15/86
cb026509 6.\"
95f51977 7.TH USLEEP 3 "May 15, 1986"
cb026509
KM
8.UC 6
9.SH NAME
10usleep \- suspend execution for interval
11.SH SYNOPSIS
12.nf
13.B usleep(useconds)
14.B unsigned useconds;
15.fi
16.SH DESCRIPTION
17The current process is suspended from execution for the number
18of microseconds specified by the argument.
19The actual suspension time may be an arbitrary amount longer
d9d2c099
MK
20because of other activity in the system
21or because of the time spent in processing the call.
cb026509
KM
22.PP
23The routine is implemented by setting an interval timer
24and pausing until it occurs.
25The previous state of this timer is saved and restored.
26If the sleep time exceeds the time to the expiration of the
27previous timer,
28the process sleeps only until the signal would have occurred, and the
d9d2c099
MK
29signal is sent a short time later.
30.PP
31This routine is implemented using
32.IR setitimer (2);
33it requires eight system calls each time it is invoked.
34A similar but less compatible function can be obtained with a single
35.IR select (2);
36it would not restart after signals, but would not interfere
37with other uses of
38.IR setitimer .
cb026509
KM
39.SH "SEE ALSO"
40setitimer(2), getitimer(2), sigpause(2), ualarm(3), sleep(3), alarm(3)