Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: ATT Unix millisec clock Message-ID: <3861@auspex.auspex.com> Date: 9 Aug 90 21:35:53 GMT References: <3213@uniol.UUCP> Distribution: comp Organization: Auspex Systems, Santa Clara Lines: 27 >We faced the same problem, finer than one-second resolution, here before. >We use SysV3.1 on a 68020 type too (with some BSD enhancements). Such as the "select()" call you used.... >IF you have the select call on your machine, you can build yourself a >fine tuneable sleep call. Or try the same trick with "poll()", if you don't have "select()". >If you want to have a millisecond - precise clock or somthing like that, >I'm sorry, I can offer no help. If you want the wall-clock time to higher resolution, you need an extension such as "gettimeofday()" (some systems, including S5R4, have this). If you want alarms delivered with finer-than-one-second granularity, you need an extension such as "setitimer()" (some systems, including S5R4, have this). If you want to compute the *interval* between two events with finer-than-one-second resolution, check out the "times()" call - it runs the number of clock ticks (as defined by HZ in ) since some unspecified event in the past (typically, but not necessarily, the time at which the machine was booted). You can subtract two of those return values to get the interval with finer-than-one-second resolution.