0

I have a 3rd party application that doesn't work properly if it detects a timeout condition. For some reason, my computer clock seems to lose about 90 seconds each day, so that when Windows does its daily NTP synchronization, I get Event ID 50: Time Service detected a time difference of greater than 5000 milliseconds for 900 seconds. When this happens the clock is changed by over a minute, which is sometimes enough to break my application (a change of over 60 seconds at certain particular moments in the periodic execution cycle will trigger a timeout).

I found that there is a registry setting in HKLM\SYSYTM\CurrentControlSet\Services\W32Time\TimeProvider\NtpClient called SpecialPollInterval that can force the time to sync more often which I hope will fix my problem. (Still in the process of testing). However I was wondering if there is any way to make so time synchronization happens more gradually. For example, if the clock notices it is 90 seconds behind, can it just gain 1 second every minute so that in 90 minutes its back in sync, or better yet, can it realize (after resyncing) that its about 0.1% slow and therefore every hardware second, 1.01 real seconds are transpiring so that it never needs to have time jumps again?

Update: I thought the Event ID 50 was because the clock was off by more than 5 seconds, but I am starting to believe that this isn't the case and perhaps the 5 seconds refers to how long it is taking to make a network trip or maybe that the clock of the remote time server (which in this case is a corporate computer somewhere) has changed.

Update #2: It looks like the reference for how the windows time service works is given here: https://learn.microsoft.com/en-us/windows-server/networking/windows-time-service/windows-time-service-tools-and-settings

I think the 5000 milliseconds is actually the LargePhaseOffset which is described as:

Specifies that a time offset greater than or equal to this value in 10-7 seconds is considered a spike. A network disruption such as a large amount of traffic might cause a spike. A spike will be ignored unless it persists for a long period of time. The default value on domain members is 50000000. The default value on stand-alone clients and servers is 50000000.

(Note that 50000000 * 10e-7 seconds = 5 seconds = 5000 milliseconds)

The 900 seconds must be the SpikeWatchPeriod which is described as:

Specifies the amount of time that a suspicious offset must persist before it is accepted as correct (in seconds). The default value on domain members is 900. The default value on stand-alone clients and workstations is 900.

1
  • To put it simply NTP breaks when there is a huge time difference. You probably have a lousy DNS server that’s to blame. Can you fix the time gradually, yes, but HTTPS also starts to break with large time differences between client and server.
    – Ramhound
    Nov 22, 2022 at 19:01

1 Answer 1

0

SpecialPollInterval is in seconds, so to sync every 10 minutes would require a value of 600 decimal or 258 in hexadecimal. It's not enough by itself, so also requires SpecialInterval to be turned on by a non-zero value.

Paste the following text in a .reg file and double-click it to execute:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient]
"SpecialPollInterval"=dword:00000258
"SpecialInterval"=dword:00000001

Reboot for it to have effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.