Products > Computers
Does Windows (7+) NTP time sync actually work?
peter-h:
I am testing a GPS-NTP product but this issue is found with any of the NTP time sources which can be configured under Control Panel / Date & Time. Basically the PC time differs by 1 to 1.5 seconds - occassionally much less - from the "proper time" as shown by say time.is
AIUI, NTP should sync the PC's RTC "exactly" but instead is seems to randomly gain, sometimes lose, a second. Is the MS code just crap because the PC RTC (based on the original 1980s Hitachi 6818 - can't find the data sheet on it now) holds only seconds, so there is no "trivial" way to load it accurately from a seconds+milliseconds value obtained via NTP? Obviously one could do it by taking the NTP time, say 30.345 secs, and wait for 655 milliseconds and then load 31.000 into the RTC.
Monkeh:
Yes, it works exactly as well as a daily sync can be expected to. Mine, for example, last synced at 0322, so is now 1.3 seconds off. When running your PC entirely ignores the RTC (which is much more stable than this), all timekeeping is done essentially in software, and is subject to substantial drift over time.
If you want a Windows system to maintain time accurately you'll need to install a suitable service to perform continual adjustment. Windows does provide one, normally only activated when connected to a domain, and I've never bothered to dig into configuring it. Personally, I'd suggest just good old fashioned 'ntpd': https://www.meinbergglobal.com/english/sw/ntp.htm
peter-h:
We may have wires crossed.
WinXX workstation syncs once a week. So with a 20ppm xtal it can be 11 seconds off. One can edit the registry entry (followed by a reboot!) to say 100 secs (I believe, the default for winXX Server) but you see the same error.
Now I can well believe that Windows does not read the RTC except when it boots up, and normally it counts time with a 1ms interrupt. But then what does the time sync actually do? It should set the RTC and set its internal ms count. But let's say the RTC setting is only +/- 1 sec; the 1ms based clock should be settable to the nearest 1ms and then going to e.g. time.is should show that. Unless time.is use client javascript to read the RTC...
What does the above NTP package actually do? It doesn't actually say. At least, it must fix up the 1ms clock. But why doesn't the Winxx NTP service do that?
I tried to install it but failed; don't really understand what it is trying to do. It was asking for firewall modifications but they should already be in place for the Windows NTP process. I installed it but could not find anything under Services afterwards. So I uninstalled it.
Monkeh:
If you perform a manual sync, your time should then be exactly right. Mine certainly is (okay.. it's slipped 100ms or so since I synced it..). How Windows handles the RTC I don't know - usual practice in an OS is not to mess with it except maybe to set it to the nearest second on shutdown.
ntpd will continuously monitor your chosen servers and sync the current clock much more precisely than any 24h+ interval. The Windows service doesn't do that because they don't want to maintain the infrastructure to supply NTP to billions of machines - if you set up a domain, the domain controller will become an NTP server and joined machines will be configured to maintain their clocks properly.
peter-h:
OK; posts crossed.
I have been doing manual sync here
but it seems to have no effect.
Navigation
[0] Message Index
[#] Next page
Go to full version