portable way to do nap()

Dave Hiebeler hiebeler at rpics
Mon Oct 3 03:35:32 AEST 1988


In article <543 at mpx1.UUCP> erik at mpx1.UUCP (Erik Murrey) writes:
>How can I do a portable nap()?  A nap() (under XENIX) allows
>a user process to block for a short time, usually a few hundred ms.
>...
>I hear that some systems have a special device for nap()-ing, and
>others use select(), and still others are stuck with using a
>CPU intensive while() loop using the times() call.

 I'm not sure if this is what you're asking, but in SunOS 3.x and later,
there's a routine called usleep() which sleeps for the specified number
of microseconds.  I don't know if this routine exists in other Unix
variations (though I don't believe it exists in Sequent's Dynix, when
I was looking for it about a year ago).  Hope that helps..
----
Dave Hiebeler      Internet: hiebeler at cs.rpi.edu  (preferred address)
R.D. Box 225A                userfrzk%mts at itsgw.rpi.edu
Chatham, NY 12037    Bitnet: userfrzk at rpitsmts.bitnet
  "xue zai xao"



More information about the Comp.unix.wizards mailing list