Atomic Clock Time Synchronization

Digerati

Moderator
Hardware Expert
Microsoft MVP (Ret.)
Staff member
Joined
Aug 28, 2012
Posts
4,959
Location
Nebraska, USA
It seems Microsoft (once again) reset some user changes in the Registry back to Microsoft's idea of what the defaults should be. This time they did it through the Windows 10 Anniversary update. One of those changes was the polling interval Windows synchronizes your computer's system clock with the NIST (National Institute of Standards and Technology) atomic clock time servers.

I have to admit, I am a bit anal when it comes to clocks being accurate. I suspect this goes back to my old military days as a communications technician where it was often "mission essential" for our global communications systems to be exactly in sync. Only back then, instead of networked servers we had to sync our systems to WWV.

In "wide area" computer-based information networks, information to a single database, for example, may be added, deleted, or modified from multiple locations anywhere in the world. Latency issues arise as data sent from distance places bounce off satellites and "hop" through multiple points towards the final destination.

It is critical these database changes are made in the correct chronological order so the most recent information is always "on top". This can only be accomplished if every single data packet sent over the network has an accurate "timestamp" embedded at the time of entry/transmission so the data is reassembled at the final destination in the correct order.

Personal computers are not very accurate time pieces. They use a "real time clock" (RTC) device (which is really an accurate "counter" and not a clock) that typically relies on a crystal oscillator or IC running at 32.768KHz that is then used to generate a hexadecimal number to represent x number of seconds since the "system" clock was last "set". These devices are always "counting". Even with power completely removed from your computer, the CMOS battery in your computer has the added task of keeping the computer's RTC "ticking".

Because personal computers are not very accurate "chronometers", even a brand new computer with a good CMOS battery can lose (or gain) several seconds or even minutes every day. This is due, in part, for 2 reasons. (1) A more accurate RTC will add considerably more to the cost of the motherboard/computer and (2), it is easy to program the operating system to periodically synchronize the RTC to an extremely accurate atomic clock over the computer's network/Internet connection - thus alleviating the need for a very accurate (and expensive) RTC in the first place.

The problem (as I see it) with Windows is the default setting to synchronize the computer's clock is once every 604,800 seconds, which is just once a week. If your computer is one where that clock "drifts" many seconds or even minutes a day, your system clock could be off significantly after one week.

There is an easy fix for this, however, involving a simple Registry hack.

One important word of caution first. Changes to the Registry with Windows Registry Editor (regedit) are done in "real time". That is, any change you make is done immediately and there is no log or history of recent changes to see what you did. So I recommend you backup the Registry or make a new Restore Point before making any changes, just in case you accidently change a wrong setting.

In Windows 10, manually creating a Restore Point is easy. In Settings, start typing in the search box, create a restore point and when you see that option appear, click on it. A System Properties window should open with the System Protection tab open. Click on Create, then enter a name/description for the Restore point in the new window. I used "change time poll interval". Then follow the prompts to proceed.

Now to change the interval, start the Registry Editor by entering regedit in the start menu search box or Cortana.

Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\W32Time\TimeProviders\NtpClient

Double click on SpecialPollInterval to open that DWORD value. Click on the Decimal radio button then in the Value data: field, inter the interval value you want in seconds.

For example, enter:

86400 for every 24 hours (my choice and recommendation),
3600 for ever hour,
144000 for every 4 hours,
43200 for twice a day.​

Click OK, then exit Registry Editor and that's it.
 
Hi Digerati. :smile9:

According to When SpecialPollInterval is used as a polling interval, the Windows Time service does not correct the time if the service gets into Spike state) (click):
If the value of the NtpServer entry in this subkey contains 0x1, Windows Time uses SpecialPollInterval as the polling interval.
Otherwise, Windows Time uses MinPollInterval/MaxPollInterval.
I've right now changed the default server (from the GUI) with one in Italy, and these are the values:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters]
"NtpServer"="2.it.pool.ntp.org,0x9" ( this is a REG_SZ - normal string value)

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\W32Time\Config]
"MaxPollInterval"=dword:0000000f (decimal 15 --- this is a dword 32-bit)
"MinPollInterval"=dword:0000000a (decimal 10 --- this is a dword 32-bit)
Hence it seems my PC clock it is currently updated between 10 and 15 seconds, given that value doesn't contain 0x1... Is this correct?
 
Hmmm, not seen that but I wonder how prevalent the problem is that the service gets into a spike state? I bet that is pretty rare. I also note the SpecialPollInterval is used by default.

When I read that it seems all three of the following conditions must be true:
•The NTP client syncs its time with the manually specified NTP server.
•The NTP client uses SpecialPollInterval as a polling interval.
•The time offset between the NTP client and the NTP server is greater than the LargePhaseOffset as configured in the NTP client.
In looking at my settings, there is no LargePhaseOffset entry. I don't have Max or Min Pool Intervals either. Did you add those manually?

Finally, I don't use windows.time though I did and didn't have any problems (other than it only checked once a week) I changed mine to time.nist.gov because Windows Time, at least here in the US, syncs to the nist time servers anyway.

What version of Windows are you using? And how do you connect to the Internet? Are you on a domain?

I don't know how foreign versions of Windows set up time synchronization. It maybe quite different from what I am used to seeing.
 
This is the default registry code exported (except for the Italian server, I exported it after I changed the server) --- I'm using Win10H x64:
Read More:
Anyway, from what I've understood from that article, the default behaviour is w32time use those two values, but I'm not sure at all of it...
I think it could use instead the UpdateInterval, but its value is in clocks (360000 pc clocks?)...
 
You have dozens more entries under the W32Time section than I do and for sure, while I know my way around the Registry, I am no expert here. It does not help that export exports in hex, not decimal so some is hard to understand. For example, on my system under NtpClient > SpecialPollTimeRemaining, with Regedit I see the time server I am using and time remaining (time.nist.gov,7d17d1c). The server is correct but I sure don't know what 7d17d1c means because in decimal, that works out to 4.1 years!

And when I export that field, I see
Code:
"SpecialPollTimeRemaining"=hex(7):74,00,69,00,6d,00,65,00,2e,00,6e,00,69,00,73,\
  00,74,00,2e,00,67,00,6f,00,76,00,2c,00,37,00,64,00,31,00,37,00,64,00,31,00,\
  63,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00

And who knows what the says?

Are you having problems syncing your time? If you do it manually, does it sync?

I note yours is set to the default of 93a80 (hex) seconds, which is 604800 in decimal for every 7 days.
 
I think all is working.
I modified the server from "NtpServer"="2.it.pool.ntp.org,0x9" to "NtpServer"="3.it.pool.ntp.org,0x1" and "SpecialPollInterval"=dword:00093a80 (604800 seconds = 1 week) to "SpecialPollInterval"=dword:0000a8c0 (43200 seconds = 12 hours).
Where can we check the time events?
 
Events? I don't know but from a command prompt, you can enter: w32tm /query /status which provides a bunch of information and w32tm /query /configuration tells you your current config. w32tm /? tells you all the options.
 

Has Sysnative Forums helped you? Please consider donating to help us support the site!

Back
Top