
SLEEP(3)                   UNIX Programmer's Manual                   SLEEP(3)

NNAAMMEE
     sslleeeepp - suspend process execution for interval of seconds

SSYYNNOOPPSSIISS
     ##iinncclluuddee <<uunniissttdd..hh>>

     _i_n_t
     sslleeeepp(_u___i_n_t _s_e_c_o_n_d_s)

DDEESSCCRRIIPPTTIIOONN
     The sslleeeepp() function suspends execution of the calling process for
     _s_e_c_o_n_d_s of time.  System activity or time spent in processing the call
     may lengthen the sleep by a second.

     If a timer is already running on the process its state is saved.  If the
     value _s_e_c_o_n_d_s 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 _s_e_c_o_n_d_s has passed.

     This function is implemented using setitimer(2);  it requires eight sys-
     tem calls each time it is invoked.  A similar but less compatible func-
     tion 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.

RREETTUURRNN VVAALLUUEESS
SSEEEE AALLSSOO
     setitimer(2),  sigpause(2),  usleep(3)

HHIISSTTOORRYY
     A sslleeeepp() function appeared in Version 7 AT&T UNIX.

BSD Experimental                April 19, 1991                               1






























