So i'm working on an app that needs the client browser to trigger some javascript events on a fairly precise timeline in coordination with other browsers. I wrote a little function that grabs the server time via AJAX. For production, I can be off buy a tiny bit but I'm trying to get it as close as possible by shaving off milliseconds of lag where possible so it accounts for the connection time lost talking to the server and applies that latency to the offset value. Once the offset value is determined, the client can use the system time + the offset to trigger events at the pre-determined and coordinated times.
It seems to be working pretty well, but I notice that sometimes when I have it running on multiple devices, it looks off by up to a half second or so. Anyone care to test? The URL is
http://micahj.com/code/syncOffset/ If you could, please open that link in couple browsers and maybe a smartphone which will have a different system time than your browser, then let me know if the time seems to be accurate without noticeable phase difference.