[time-nuts] NTP to discipline Raspberry Pi

Hal Murray hmurray at megapathdsl.net
Fri Jul 26 13:13:57 EDT 2013


mc235960 at gmail.com said:
>   Most interesting.  I do however have an issue with your wording.
> "Already, this tells us that the smallest meaningful timestamp resolution on
> the Pi is 1 microsecond."

>   Timer resolution may be limited ( I haven't trawled the code), but
> timestamps are supported to nanosecond resolution as timespec{} is 64 bits.
> and clock_gettime() returns that.

Right.  But if you read the clock many times in a row, you will get several 
copies of the same value followed by several copies of the next value...

There are two different ideas here.  One is do you see low bits (below 
microsecond) when you read the clock.  The other is what size are the steps 
between values that you see.

Suppose the clock on your system is nominally 1 microsecond.  In reality, it 
will be slightly off.  If you are running ntpd, it will tell the kernel how 
far off.  The kernel will then adjust the clock by 1.000037492 microseconds 
per tick rather than 1.0, so you will see low bits.


>   That said NTP limits itself to timeval{} stamps, ie usecs.

Huh?  NTP has been doing sub-microsecond for years.

There is another quirk with NTP.  It measures the tick rate and fills in the 
bottom bits with random.  (I can't explain why.  If you are unlucky, you can 
see time going backwards.)





-- 
These are my opinions.  I hate spam.





More information about the time-nuts mailing list