[ntp:questions] how do I lock in average frequency correction

David J Taylor david-taylor at blueyonder.co.uk.invalid
Sun Feb 12 06:32:48 UTC 2012

> Hi all,
> I've been reading around in the faq's at ntp.org and various pages 
> googling around and cannot find obvious answers to these questions.
> It is my understanding that NTP is continuously making small changes to 
> the software clock to keep the timing accurate while the os is running. 
> 95% of the time, my computers are doing the same thing and 95% of the 
> time, I'm doing the same thing with the computers.  Therefore, over a 
> long time interval, the interrupt usage should be similar, and over a 
> long time interval, the correct clock frequency to maintain accuracy 
> should be similar.
> So, what I want to do is figure out what the average frequency to keep 
> accurate time is over say a week or month.  I then want to fix the 
> frequency at that level and leave it there.  Then, under normal 
> conditions, the clock should drift very little on average.  If certain 
> usage conditions, say transcoding a movie, make the clock drift more 
> rapidly, I want it to step the time or slew it for that occasion, but 
> not to alter the long term correction factor at all.  That way, when my 
> usage patterns return to normal, the drift should again return to a very 
> slow rate.

As David Lord mentioned, the drift file is supposed to achieve this.  It's 
updated on an hourly basis, so transients should not affect it greatly. 
If your PC is like mine, video encoding can last more than an hour, so 
might make a difference.  But once you have that real serial-PPS source 
running with NTP it locks a lot tighter.

> I also would like to understand how ntp interacts with the Real Time 
> Clock.  I think I've read that either NTP or the OS (I don't know which) 
> will save the time to the RTC when shutting down and retrieve the time 
> from the RTC when booting up.  I'd like to know if this is true, first 
> of all, and I'd like to know if it makes any corrections to the clock 
> rate of the RTC so it is more accurate.
> Any help is appreciated.
> Sincerely,
> Ron

There's been some discussion about this before.  I recall asking that the 
RTC be set when NTP exited, but there was some reason that either it 
couldn't be done, or was a bad idea.  I /think/ that Windows sets the RTC 
on closedown, but I have some vague recollection that even that might be 
an option.  Look back through the comp.protocols.time.ntp newsgroup 
archive (or on Google Groups) and you may find the discussion.


More information about the questions mailing list