sleep()ing less than a second

Robert Claeson prc at erbe.se
Thu Dec 21 04:55:22 AEST 1989


In article <2754 at servax0.essex.ac.uk>, peter at sersun1.essex.ac.uk (Allott P) writes:
> In article <89348.231211BACON at MTUS5.BITNET> BACON at MTUS5.BITNET (Jeffery Bacon) writes:

> >Given sleep(arg); unsigned arg. Nothing new.
> >But what if you want to sleep for less than one second, say, 0.5?

> It is possible to "sleep" for less than one second by doing a
> selcect(.......) with an appropriate value in the timeval (5th param I think)
> and with no channels to check (2nd through 4th params I think).

The same trick can be done under UNIX System V Release 3.x using the poll()
system call with appropriate values and no stream fd's to check.

-- 
          Robert Claeson      E-mail: rclaeson at erbe.se
	  ERBE DATA AB



More information about the Comp.unix.questions mailing list