# [ntp:questions] NTPD can take 10 hours to achieve stability

unruh unruh at wormhole.physics.ubc.ca
Mon Apr 18 17:51:08 UTC 2011

```On 2011-04-18, Chris Albertson <albertson.chris at gmail.com> wrote:
> On Sun, Apr 17, 2011 at 11:33 PM, unruh <unruh at wormhole.physics.ubc.ca> wrote:
>
>>> NTP works kind of like that. ?It uses a set of reference clocks and
>>> watches the rate of your local clock relative to the reference
>>> clock(s) and depending on details it make time some time
>>
>> Nice analogy. If only chrony did not demonstrate that using exactly the
>> same time interchange with an accurate clock, the computer can achieve
>> usec accuracy within less than an hour. Ie, your analogy simply does not
>> hold as a general statement.
>
> The analogy is perfect and applies to all clocks, computer based  and
> otherwise.  There is simply no way to match the rate of one clock to
> another without waiting until you are able to measure divergence.  The
> length of time you have to wait depends on the accuracy which which
> you can measure the divergence and your goal for precision.   It
> general you devide one into the other to get time.  Now if you have
> two programs and one is faster at setting the clocks rate, then you
> have an implementation detail.  What I said above defines the minimum
> time required.  Of course one would work slower.  The OP's question
> was why in theory does it take a long time, and gave no details of his
> setup.

Since you can measure the time to usec, in 1 sec you can measure rate
offsets of 1PPM and offsets of 1usec. Thus. with your arguments you
should be able to get the clock to within 1PPM and 1usec within 1 sec.,
and .1PPM within 10 sec. This is nowhere near as fast as ntpd works.
And the OP did give details of his setup-- he was refering to
experiments done with ntpd which showed that it took 10 hr to recover
from a 40PPM rate change in the system clock (those experiments used a
GPS clock as the time source, with a interrupt service routing with
directly timestamped the interrupt immediately as it came in, so noise
in the external clock was not a problem).

```