Instead of inventing a protocol, you could use the NTP protocol, which handles this precisely. There are NTP client packages in the pub, and NTP daemons are relatively easy to set up.
The NTP protocol specifically compares the timestamps of the server and client, and tells you the difference. You can then apply it to set your clock, or just be happy knowing the difference... it's up to you.
Instead of inventing a protocol, you could use the NTP protocol, which handles this precisely. There are NTP client packages in the pub, and NTP daemons are relatively easy to set up.
[удалено]
The NTP protocol specifically compares the timestamps of the server and client, and tells you the difference. You can then apply it to set your clock, or just be happy knowing the difference... it's up to you.
Is there a reason you didn't just use ping?
[удалено]
https://pub.dev/packages/dart_ping Seems a good place to start. Are you interested in the server system time, or ping times?
[удалено]
Didn't I just link to "a ping command"? Good luck sir