man(1) Manual page archive


     SLEEP(3)                                                 SLEEP(3)

     NAME
          sleep - suspend execution for an interval

     SYNOPSIS
          sleep(seconds)
          unsigned seconds;

     DESCRIPTION
          The current process is suspended from execution for the num-
          ber of seconds specified by the argument.  The actual sus-
          pension time may be up to 1 second less than that requested,
          because scheduled wakeups occur at fixed 1-second intervals,
          and an arbitrary amount longer because of other activity in
          the system.

          The routine is implemented by setting an alarm clock signal
          and pausing until it occurs.  The previous state of this
          signal is saved and restored.  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
          alarm(2), pause(2)