NISTSync

V1.0.1-beta by Paul Kanevsky
Copyright © 2010 by Paul Kanevsky. All Rights Reserved.

NISTSync is freeware to synchronize your PC clock to the Internet time servers provided by NIST. Intended use is where the precise time (to within +/-10 milliseconds)  is important. For Astronomical use, timing of occultations, search for extra-solar planets, and measuring precise position of objects are some of the tasks that may require this level of precision.

 

Disclaimers and Copyright

Copyright © 2010 by Paul Kanevsky. All Rights Reserved.

NISTSync is provided free of charge for all non-commercial use. Permission is given to distribute NISTSync in its original, un-modified form and only free of charge. The author accepts no responsibility for direct or consequential damage caused by the use of this software: use it at your own risk!

NISTSync is provided as-is, and although I will attempt to make changes and fixes as they become necessary, I provide no guarantees about its suitability for any purpose whatsoever.

 

The Problem

Microsoft Windows provides a simple time synchronization with an internet server, but its accuracy leaves something to be desired, and can be off by as much as 1 second. Furthermore, this synchronization happens with long intervals in between, leaving the PC clock to run ahead or behind by many seconds, sometimes in a single day. Here’s the measured clock from my high-end laptop over a period of 35 minutes (the Y axis is in milliseconds, the X axis in minutes):

Note that left to its own devices, the clock on my PC will lose approximately 1.5 milliseconds per minute. In 24 hours, it will be running behind by over 2 seconds. Not good for precise time monitoring!

What can NISTSync do about it?

The first thing to note is that the clock has an almost constant linear drift down. It would be very nice to be able to adjust the speed of the PC clock up or down to eliminate the constant drift. NISTSync has a built-in drift removal function. This function works by adjusting the rate of the PC time keeping clock, so as to eliminate all measured drift. The adjustment is done in Windows, so that once adjusted, Windows will continue to track time at the corrected rate, even if you don’t use NISTSync.  Here’s what my PC clock looks like after drift-correction with NISTSync (this was measured over a period of two hours):

 

Looks a bit more ugly than the first chart, but look at the scale on the Y axis! Even after two hours, the final error is still within 2 milliseconds of the Internet  NIST clocks. Overall, the error stays within +/-10 milliseconds for the whole time. Even the occasional spikes remain well within the +/-10 millisecond interval.

 

So, can anything be done to improve the clock precision even further? In addition to the clock drift removal, NISTSync also provides a periodic update function that can execute at an interval of 1 or more minutes. Each time it executes, NISTSync will update the PC clock to the latest, correct time from the Internet. Here’s a chart showing my PC clock over a period of 8 hours while NISTSync updated the PC clock at a rate of once per minute:

 

 

Note that the overall precision is well within the desired +/-10 milliseconds range for the whole 8 hours. Since the drift was already removed, it is possible to increase the update interval to once every 5 minutes or less and still achieve the desired accuracy.

 

What do I need to do to make it work?

First, download and install NISTSync.

Start it from the desktop icon:

NOTE: the program can only set the PC clock when used in full administrator mode. Under Windows Vista, or Windows 7, you might need to either turn off UAC, or create a new shortcut and run it “As Administrator” from there. The executable file for the new shortcut will be in C:\Program Files\PKAstro\NISTSync

 

Sync button performs an immediate synchronization with the Internet clocks and set the PC clock. The time and date are displayed next to the button.

 

Difference button measures the difference between the PC clock and the Internet time sources. The result is displayed next to the button, in milliseconds.

 

Err Range shows the error spread between all the Internet time sources used in the last synchronization or difference measurement. This is the maximum error produced by all the time sources that were consulted. NISTSync ignores time sources that produce a very large difference compared to others, and also averages all the time sources that are not ignored. In this way, the accuracy of the measurement is always better than the Err Range value would indicate.

 

Drift represents a measured linear drift in the sequence of measurements. At least 5 measurements are needed before a drift value is computed. The more measurements, the better the accuracy of the drift value. I usually wait for 30 minutes to an hour before judging the drift value, and making a correction.

 

Fix Drift button applies a constant correction to the PC clock based on the computed drift value. The more accurate the computed drift value, the better the fix will be. Once applied, the correction will be in effect until the next time the PC is rebooted. You can measure remaining drift after a drift correction, and use Fix Drift again to remove any residual drift. This procedure can be repeated as many times as is necessary.

 

Auto Update when checked, will automatically check the Internet time servers on a periodic basis. The period can be selected to the right, starting with a 1 minute interval.

 

Auto Sync option applies only when Auto Update is also selected. If checked, this option forces NISTSync to set the PC clock to the correct time from Internet time sources each time the Auto Update is performed (based on selected interval). If Auto Sync is not checked, the Auto Update will still run with the same interval, but will only measure the difference between the PC clock and the Internet time sources — PC clock will not be adjusted in this case. This is useful for measuring clock drift or when trying to determine how accurate your PC time keeping function really is.

 

Run NISTSync on logon when checked, this will tell Windows to start NISTSync automatically, whenever the user logs into the computer. All the previously used settings will be remembered, including Auto Update and Auto Sync options, and interval.

 

Difference Chart shows the history of all the auto updates performed by NISTSync since the chart was cleared (Clear Chart function). The Y axis shows the difference between PC and Internet clocks,  in milliseconds, and the X axis counts the number of minutes.

 

Clear Chart clears the chart and restarts it from the beginning. It also clears all the data used for drift measurement, so drift computation will be restarted from scratch once Auto Update will run. Next to this button, you’ll find a display of Count which indicates the number of measurements taken, and Error, which represents RMS error, in milliseconds, computed for all of the shown measurements.

 

Communicate problems, suggestions, comments

If you're having problems using NISTSync or have comments or suggestions for improving it  drop me a line here.

 

Download