0

Question:

On a machine that has its external clock synchronizations switched off how can I reset the clock to its normal rate? that is what should I set the timeAdjustment parameter of SetSystemTimeAdjustment function to?

Description:

My goal is to synchronize clocks across thousands of machines in such a way that clock always goes forward. If for whatever reason a clock needs to be set back clock rate slows down.

I have made an observation that my workstation presents very different timeAdjustment values fetched with the function getSystemTimeAdjustment. Sometimes I am getting 155854 (# of 100ns), sometimes 156002 sometimes other values. Yes, I know it is 15.58ms versus 15.60ms but still the issue persists. My best guess so far is that whoever is in charge of my workstation’s clock adjustments (domain controller?) sets these value according to the clock drift which in turn depend on many other physical factors.

On a machine that is not connected to domain controller and has its synchronization with Internet time servers disabled I have been observing clock drift measured in seconds per 10 minutes what after reading Jeff's article on PC clocks makes me think that such a drift is nothing unusual at all.

If the drift was constant I could just restore the value from before I started changing clock rate (which is a good approximation), but clock drift is not constant.

Primarily coding in C#. Will accept answers in C++ too.

4

1 回答 1

1

这篇博文解释了 Windows 时钟背后的奥秘。在我看来,服务器开始听起来不错。

http://www.mathpirate.net/log/2010/03/20/temporal-mechanics-sharing-the-speed-of-time-part-ii/

于 2013-09-15T17:46:43.083 回答