* xana...@gmail.com <xana...@gmail.com> [170915 12:33]:
> Yes, I have also tried this on separate devices and some were off and some 
> were exact to the second so this is definitely a frontend therefore 
> javascript issue and not an issue with golang. Not sure how to fix it but 
> this is not a question for golang-nuts forum now. Thank you for your time.

I would not say this is a javascript issue; it is really a general
programming issue about how to deal with networked machines having
different clocks.

The simplest, and most likely best, solution is to make sure the server
and all clients synchronize their clocks with an established time
standard, using software such as ntp.

If this is not possible, the problem starts to get hard very quickly,
and depends on many factors, including how important it is for the
client display to be accurate and the range of network latency between
the various clients.

If network latency is typically small, and you don't mind the display
being off by the current network latency, you can have the server send
its idea of the current time, and have the client store the delta and
use that to adjust the displayed value (details left as exercise for the
reader!).

...Marvin

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to