Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to accurately sync time between iPhones?

Tags:

time

iphone

I am writing an application that will require me to sync the time on a large number of iPhones accurately (to within a fraction of a second). As far as I can tell, access to the time function of the GPS is not available. If I sync over the Internet, then the biggest problem is network latency. The delay before the answer to a request is received can be estimated to be half the round trip - but how accurate can I expect this to be? Would it be worthwhile sending multiple requests and averaging or is there another better way of synchronising time?

like image 950
Casebash Avatar asked Feb 15 '10 05:02

Casebash


People also ask

How do I get my iPhone to sync the correct time?

Go to Settings > General > Date & Time. Turn on any of the following: Set Automatically: iPhone gets the correct time over the network and updates it for the time zone you're in. Some networks don't support network time, so in some countries or regions, iPhone may not be able to automatically determine the local time.

Will iPhone automatically sync when connected?

Simply select the “Automatically sync when this [device] is connected” checkbox in the General pane, then turn on syncing for each type of content you want to sync. Your Mac and iPhone, iPad, or iPod touch update to matching content whenever you connect them.

Is Apple iPhone time accurate?

Apple's NTP servers make sure iPhones and Apple Watches keep time at "Stratum One" accuracy, within milliseconds of "Stratum Zero" devices. Speaking to The Telegraph, Lynch also described the hardware inside of the Apple Watch that makes sure the time remains accurate.


1 Answers

Try implementing Marzullo's algorithm, as notably used in NTP.

like image 79
David Avatar answered Nov 15 '22 05:11

David