In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Garrett Wollman) wrote:
> In article <[EMAIL PROTECTED]>, > Richard B. Gilbert <[EMAIL PROTECTED]> wrote: > >The precision shows as "-21" or about 1 microsecond and, indeed, the > >smallest difference between two consecutive calls to gettimeofday() is > >one microsecond. > > gettimeofday(), by definition, returns microseconds. > > If you want nanoseconds, you need clock_gettime(). No new code should > be using gettimeofday(). The _format_ resolution of clock_gettime() is one nanosecond, but the granularity of the underlying clock need not be finer than 20 milliseconds, according to IEEE Std 1003.1. The purpose of the nanosecond format resolution is portability of application software. The Solaris and IRIX boxes I have measured have ~microsecond clock granularity, not nanosecond. Has this recently changed? Joe Gwinn _______________________________________________ questions mailing list [email protected] https://lists.ntp.isc.org/mailman/listinfo/questions
