Path: utzoo!attcan!uunet!cme!durer!rowe From: rowe@cme.nist.gov (Walter Rowe) Newsgroups: comp.unix.internals Subject: Re: Can Unix sleep in terms of mili/micro? Message-ID: Date: 14 Sep 90 13:18:12 GMT References: <24437@adm.BRL.MIL> <84@dlss2.UUCP> <1990Sep12.231326.19897@virtech.uucp> Sender: news@cme.nist.gov Organization: National Institute of Standards and Technology Lines: 39 In-reply-to: cpcahil@virtech.uucp's message of 12 Sep 90 23:13:26 GMT To quote a SunOS man page: ====================================================================== NAME usleep - suspend execution for interval in microseconds SYNOPSIS usleep(useconds) unsigned useconds; DESCRIPTION Suspend the current process for the number of microseconds specified by the argument. The actual suspension time may be an arbitrary amount longer because of other activity in the system, or because of the time spent in processing the call. The routine is implemented by setting an interval timer and pausing until it occurs. The previous state of this timer is saved and restored. If the sleep time exceeds the time to the expiration of the previous timer, the process sleeps only until the signal would have occurred, and the signal is sent a short time later. This routine is implemented using setitimer() (see getiti- mer(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); it would not restart after signals, but would not interfere with other uses of setiti- mer. SEE ALSO getitimer(2), sigpause(2V), alarm(3V), sleep(3V), ualarm(3) ====================================================================== wpr --- Walter P. Rowe ARPA: rowe@cme.nist.gov System Administrator, Robot Systems Division UUCP: uunet!cme-durer!rowe National Institute of Standards and Technology LIVE: (301) 975-3694