Sleep time interval

Robert Claeson prc at erbe.se
Thu Nov 8 07:57:23 AEST 1990


In a recent article martin at macadam.mqcs.mq.oz.au (Martin Foord) writes:

>Is the smallest interval of sleep time the integer 1? Is there anyway of
>sleeping from a C program for a smaller period of time ?

In general, yes. But Xenix and System V Release 3.2-4.0 has the "nap()"
function, which allow sub-second sleeps. Some systems has a "usleep()"
function for the same purpose. System V Release 3.0 and 3.1 can be
tricked into doing this with the "poll()" system call, and BSD systems
can be fooled into doing this using the poll-like "select()" system call.

Came to think of it, nap() and usleep() are probably implemented as system
calls on most systems.

-- 
Robert Claeson                  |Reasonable mailers: rclaeson at erbe.se
ERBE DATA AB                    |      Dumb mailers: rclaeson%erbe.se at sunet.se
Jakobsberg, Sweden              |  Perverse mailers: rclaeson%erbe.se at encore.com
Any opinions expressed herein definitely belongs to me and not to my employer.



More information about the Comp.unix.questions mailing list