[ntp:questions] help with setting up NTP on windows with a USB GPS

jack j.jack.wang at gmail.com
Tue Dec 1 22:18:15 UTC 2009


On Dec 1, 5:11 pm, Dave Hart <daveh... at gmail.com> wrote:
> On Dec 1 16:58 UTC, jack wrote:
>
> > I have a related question: given that my system clock is synced to an
> > external GPS within ms, how do I read time that gives me the same
> > accuracy? When I tried to read time at 60Hz, I found that the times
> > returned are not periodic, sometimes even the same.
>
> Depending on the version of Windows, hardware, and the interface used
> (GetSystemTime[AsFileTime] vs timeGetTime/GetTickCount) the best
> resolution you can get for the clock is 0.5ms, the worst about
> 15.625ms.  To do better you need to query ntpd using the NTP protocol
> -- gin up a mode 3 (client) packet and send it to UDP 127.0.0.1 or ::1
> port 123 and grab the time from the resulting mode 4 response.  You
> can look at the sntp source code (not yet ported to Windows) for a
> guide.
>
> Cheers,
> Dave Hart

Dave,

Thanks for the query suggestion. That is what I plan to do. I am now
looking at ntpq code. I plan to query ntpd periodically and use the
high performance counter to keep time in between. If the query time is
negligible, I should get very accurate time. However, I have no way of
calibrating the query time.

Jack




More information about the questions mailing list