1SLEEP(3) Library Functions Manual SLEEP(3)
2
3
4
6 sleep - suspend execution for interval
7
9 sleep(seconds)
10 unsigned seconds;
11
13 The current process is suspended from execution for the number of sec‐
14 onds specified by the argument. The actual suspension time may be up
15 to 1 second less than that requested, because scheduled wakeups occur
16 at fixed 1-second intervals, and an arbitrary amount longer because of
17 other activity in the system.
18
19 The routine is implemented by setting an alarm clock signal and pausing
20 until it occurs. The previous state of this signal is saved and
21 restored. If the sleep time exceeds the time to the alarm signal, the
22 process sleeps only until the signal would have occurred, and the sig‐
23 nal is sent 1 second later.
24
26 alarm(2), pause(2)
27
28
29
30 SLEEP(3)