Reputation: 16622
I want to synchronize the time with NTP over JavaScript. The client can be a normal pc or a smartphone or tablet. The connection could be WLAN or 3G, etc.
I already found this questions and sites
first and second links using the a timestamp from this server: http://json-time.appspot.com/time.json
But the date object has only second precision. I want a better precision, if possible ~ 10 ms. (I know the precision depends on the connection and round trip time)
Edit: 10 ms is almost impossible. I want the most precision offset.
The third link shows a JavaScript library, but it does not use a direct connection to a ntp server. The solution of the fourth link is most near to that what I want. But its for synchronizing two clients through a 'own' server. Is there a way to synchronize it directly to a ntp pool like pool.ntp.org
?
Upvotes: 5
Views: 10676
Reputation: 840
An NTP client servos the computer's own internal clock for resolution. The client must estimate UDP round trip times and change the inernal clock rate ,slowly, to minimize the average error.
Upvotes: 1