G
G
GuardFromUa2016-09-29 16:51:34
Java
GuardFromUa, 2016-09-29 16:51:34

Is it possible to do time synchronization?

It is necessary to make time synchronization of 30 devices (so that the countdown on these devices starts synchronously, and now there is a big difference in the beginning of the countdown).
How can this be implemented directly in the program? (i.e. set the same time on all devices)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Tsilyurik, 2016-09-29
@Olej

How can this be implemented directly in the program? (i.e. set the same time on all devices)

You will not be able to perfectly synchronize the timelines. Because synchronization is a network operation, and desynchronization will include network propagation time (which fluctuates randomly).
Naturally, synchronization with NTP on the WAN will be much rougher than synchronization on the LAN.
Once upon a time, I did synchronization of hosts in the LAN, and by means of a certain (simple) mathematical processing, it was possible to synchronize the time scales with an accuracy of microseconds (up to 10). But this was done in the QNX real-time OS, in Linux it will be worse, but not by much. And your Android is Linux.

A
aol-nnov, 2016-09-29
@aol-nnov

you need to google in the direction of "delay / latency compensation algorithm"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question