HOWTO: Correct and avoid clock skew on Windows and OS X platforms

Wednesday, December 16th, 2015 at 8:44 pm | 8,511 views | trackback url

ntpd-server-statsThis has come up a lot recently in the context of Zwift rides and races, becasue many rider’s PC and Mac gaming rigs are suffering clock skew. In short, it can be defined as:

“Clock skew is when the clock arrives at different points of the circuit at different times due to the distance, capacitance etc which may cause it to malfunction.”

If you want more detailed set of diagrams and explanations describing clock skew, there’s a great discussion on the StackExchange electronics forum about it.

When your machine is suffering from clock skew, you can inadvertently enter a ride or race earlier or later than you meant to do, and your overall finish time can be later than you expect. For races where the winner is separated from the other podium places by mere seconds or less, having an accurate clock matters!

Here’s how to fix it for both Microsoft Windows and Mac OS X platforms!

Fixing Clock Skew on Microsoft Windows

Windows LogoOn Windows, there are a few places where Time is adjusted, and even though you may think your system is configured correctly to keep time accurate, it’s probably not accurate enough. Let’s take care of that right now.

  1. First, click on the clock in the lower-right corner and bring up the little calendar and clock preferences. They’ll look like this:
    Windows System Tray clock
  2. On the bottom, click “Change date and time settings”
  3. A new dialog will come up with severa tabs. You want the third tab labeled “Internet Time”.
    Windows date and time settings
    Windows-Internet-time-settings
  4. On this tab, click on “Change Settings”, and you should see a dialog that looks like this:
    Windows Internet time settings
  5. Clicking on “Update now” here may give you an error message, like it did on 3 of my Windows machines.

    Even if you do not see any errors, you still need to adjust the time settings here and elsewhere. Make sure you DO NOT choose a Microsoft time server (time.windows.com) from the dropdown in the list. That array of servers is known to be very slow, lagged and incorrect. Use another server closer to you, one that is accurate for your country or timezone.

    A good place to start is pool.ntp.org.
    Windows set Internet time
    Windows unable to start Windows Time service
    We’re going to fix that error and give Windows a boost with the correct time servers.

  6. Go to Start → Run, or use Windows-Key + R and type “services.msc” as shown here and hit Enter or click on it in the list:
    Windows Services Management
  7. When the Services Management applet opens, click the “Name” column until it sorts reverse alphabetically (Z at the top). Scrolling down a little bit, you should see a “Windows Time” listed (highlighted here).
    Windows Services Management applet
  8. Double-click on that entry to bring up the service details. You’ll see a window like this. Your value may be set to “Manual” (indicated here), or it may be set to “Automatic” or “Disabled”.

    Windows Time Properties

    Whatever it’s value, set it to “Automatic” and then click on “Start” to start the service. If there are no other service conflicts, you should see something like this:

    Windows Time Service started

  9. We’re not done yet! Now we need to set some options from the commandline. Open up an elevated CMD prompt by going to Start → Run (or Windows-Key + R) and typing CMD but do not hit Enter yet! Right-click on the CMD that shows up in the search list and choose “Run as Administrator”.

    Run as Administrator

    Even if your main user account has Administrator privileges, you need to use the actual Administrator elevated privileges to open this prompt.

  10. In this new command prompt that opens, cut and paste the following line. You may want to change your NTP servers to match the ones you found in Step 5 above.
    w32tm /config /update /manualpeerlist:"0.pool.ntp.org,0x8  1.pool.ntp.org,0x8 2.pool.ntp.org,0x8 3.pool.ntp.org,0x8"  /syncfromflags:MANUAL

    Windows ntp CLI options

  11. Now to be thorough, reboot the machine and verify that the Windows Time service is starting on its own, and your clock is current and accurate.

That’s it, you’re done for Windows!

Fixing Clock Skew on Mac OS X

Apple LogoThings are a little bit different between Mac OS X and Microsoft Windows, but not terribly so. Let’s fix your OS X time to negate clock skew.

  1. Hit Cmd to bring up Spotlight Search and type in the word “System” to locate “System Preferences”. Your results should look like this:

    OS X System Preferenes

  2. In System Settings, you’ll see a number of applet icons. The one we’re interested in is “Date & Time”, shown highlighted here:

    OS X Date and Time applet

  3. When you launch this applet, you’ll have several options. You may have some selected, such as “Set date and time automatically” as shown here. The server selected here was selected as the default from my timezone during the initial OS installation. We’re going to change this to select one from pool.ntp.org (or your own local country’s preferred Stratum 1 NTP server):

    OS X NTP Defaults

  4. Change the ‘time.apple.com’ entry here to the one that matches your timezone and region. Just overtype the entry in the box with your new NTP server. I’m using pool.ntp.org directly in the below example:

    OS X pool.ntp.org Settings

    When you make a change to the settings here (basically every time you click the check-box, or change the server address, or perhaps just open the applet), OS X will rewrite your /etc/ntp.conf based on the information you have provided, then kill and restart the ntpd service on your machine.

    Note: If you’re using OS X Mavericks, there are some time drift gotchas to be aware of. You may need to tweak your configuration slightly to accommodate them.

That’s it, you’re done for Mac OS X!

Additional Resources

Last Modified: Wednesday, December 16th, 2015 @ 22:22

Leave a Reply

You must be logged in to post a comment.

Bad Behavior has blocked 1730 access attempts in the last 7 days.