Path: utzoo!attcan!uunet!husc6!mailrus!cornell!batcomputer!itsgw!imagine!rpics!hiebeler From: hiebeler@rpics (Dave Hiebeler) Newsgroups: comp.unix.wizards Subject: Re: portable way to do nap() Keywords: delay() in user space... Message-ID: <1296@imagine.PAWL.RPI.EDU> Date: 2 Oct 88 17:35:32 GMT References: <543@mpx1.UUCP> Sender: news@imagine.PAWL.RPI.EDU Reply-To: hiebeler@turing.cs.rpi.edu (Dave Hiebeler) Organization: RPI CS Dept. Lines: 18 In article <543@mpx1.UUCP> erik@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@cs.rpi.edu (preferred address) R.D. Box 225A userfrzk%mts@itsgw.rpi.edu Chatham, NY 12037 Bitnet: userfrzk@rpitsmts.bitnet "xue zai xao"