Time

I need a method of syncing time between server and client for udp packet timestamps that are accurate to within 10ms.

I know about ctime, and other such libs, but I've read that these aren't accurate due to non-realtime o/s, and application cycling.

Any suggestions on where to start looking?
If the client and server are in a LAN, NTP network time synchronization accuracy would be well under a millisecond.
Over the internet, it is difficult to get accuracy under 10 milliseconds.
http://en.wikipedia.org/wiki/Network_Time_Protocol
I figured this, but wouldn't it be possible if you used an external source for atomic clock (some website?), and adding the delta between packet send time and packet receive time?

> wouldn't it be possible if you used an external source for atomic clock (some website?),
> and adding the delta between packet send time and packet receive time?

That is what NTP attempts to do.
http://www.ntp.org/ntpfaq/NTP-s-algo.htm#Q-ALGO-BASIC-SYNC

For the gory details, see Selection Algorithm, Cluster Algorithm and Combine Algorithm (section 11.2) of the RFC https://www.ietf.org/rfc/rfc5905.txt

How accurate will my Clock be? http://www.ntp.org/ntpfaq/NTP-s-algo.htm#Q-ACCURATE-CLOCK

Topic archived. No new replies allowed.