[ntp:questions] Re: Best way to harness multiple stratum 1 servers
Joseph Gwinn
JoeGwinn at comcast.net
Fri Apr 7 15:46:51 UTC 2006
In article <e13prh$10h9$1 at grapevine.csail.mit.edu>,
wollman at csail.mit.edu (Garrett Wollman) wrote:
> In article <Epadna-QbY3q_6jZRVn-jw at comcast.com>,
> Richard B. Gilbert <rgilbert88 at comcast.net> 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
More information about the questions
mailing list