Xref: utzoo comp.lang.c:24610 comp.unix.questions:18523 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.lang.c,comp.unix.questions Subject: Re: sleep()ing less than a second Message-ID: <1937@crdos1.crd.ge.COM> Date: 19 Dec 89 19:34:26 GMT References: <89348.231211BACON@MTUS5.BITNET> <2754@servax0.essex.ac.uk> Followup-To: comp.lang.c Organization: GE Corp R&D Center, Schenectady NY Lines: 22 Reply-exos:@crdgw1:To: davidsen@crdos1.crd.ge.com (bill davidsen) In article <2754@servax0.essex.ac.uk> peter@essex.ac.uk (Allott P) writes: | 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). | See the documentation for full details. Correct. There are also vendor dependent routines in other versions. Common names are mspeel (in ms), usleep (in us, but clock tick resolution), and nap (ms again). nap is xenix and 5.3.2 and later, uspeep is SunOS and some others, don't know where msleep is from, got some source with msleep(50); /* wait 50 ms */ in it, so I know it's out there somewhere. nap and select are your best bets for portability. I *think* there's a version of nap for BSD, but I don't have it here. -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) "The world is filled with fools. They blindly follow their so-called 'reason' in the face of the church and common sense. Any fool can see that the world is flat!" - anon