[ntp:questions] TSC, default precision, FreeBSD

Miroslav Lichvar mlichvar at redhat.com
Tue Sep 8 12:40:09 UTC 2009


On Sun, Sep 06, 2009 at 03:53:23AM +0000, David Mills wrote:
> No, what you suggest is properly called resolution, not precision. Do 
> your homework; -21 is just fine for a  Sun faster than mine, where the 
> precision is -20. Confirm that the jitter.c program, included in the NTP 
> distribution for just that purpose, shows the gettimeofday() routine 
> takes on average 500 ns per call.

BTW, on current hardware the precision seems to be below the 100ns
MINSTEP limit as used in the default_get_precision routine. If the ntp
process wasn't interrupted the while loop might run forever.

Also, the calculation doesn't work correctly if the precision is below
resolution. The result is just a random value close to 100 ns. Maybe
get_systime should be called multiple times before calculating the
difference.

-- 
Miroslav Lichvar



More information about the questions mailing list