[ntp:questions] help with setting up NTP on windows with a USB GPS
Dave Hart
davehart at gmail.com
Tue Dec 1 22:11:21 UTC 2009
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
More information about the questions
mailing list