unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (4.4BSD-Lite2)
Page:
Section:
Apropos / Subsearch:
optional field

USLEEP(3)                   BSD Programmer's Manual                  USLEEP(3)

NAME
     usleep - suspend execution for interval of microseconds

SYNOPSIS
     #include <&lt;unistd.h>&gt;

     void
     usleep(u_int microseconds);

DESCRIPTION
     The usleep() function suspends execution of the calling process for
     microseconds of time.  System activity or time spent in processing the
     call may lengthen the sleep slightly.

     If a timer is already running on the process its state is saved.  If the
     value microseconds is more than or equal to the remaining clock time for
     the saved timer, the sleep time is set to the remaining clock time.  The
     state of the previous timer is restored after microseconds has passed.

     This routine is implemented using setitimer(2);  it requires eight system
     calls each time it is invoked.  A similar but less compatible function
     can be obtained with a single select(2);  such a function would not
     restart after signals, but would not interfere with other uses of
     setitimer.

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

HISTORY
     The usleep() function appeared in 4.3BSD.

4.3 Berkeley Distribution        June 4, 1993                                1