SLEEP(3) — System Interface Manual — Subroutines
NAME
sleep − suspend execution for interval
SYNOPSIS
sleep(seconds)
unsigned seconds;
DESCRIPTION
Sleep suspends the current process from execution for the number of seconds specified by the argument. The actual suspension time may be up to 1 second less than that requested, because scheduled wakeups occur at fixed 1-second intervals, and may be an arbitrary amount longer because of other activity in the system.
Sleep is implemented by setting an alarm clock signal and pausing until the signal occurs. The previous state of this signal is saved before the process is suspended and restored when the process is resumed.
If the sleep time exceeds the time to the alarm signal, the process sleeps only until the signal would have occurred, and the signal is sent 1 second later.
SEE ALSO
Sun System Release 0.3 — 19 January 1983