Is there a clock in iOS that can be used that cannot be changed by the user

后端 未结 6 1096
长发绾君心
长发绾君心 2020-11-30 02:52

I am trying to design a system where real-time events happen and I want to synchronise them to a clock. [NSDate date] would normally be ok but the user could c

6条回答
  •  悲哀的现实
    2020-11-30 03:09

    What I know, that there is no any other method to get correct time. I would use NTP.

    Network Time Protocol (NTP) is a networking protocol for synchronizing the clocks of computer systems over packet-switched, variable-latency data networks. More: http://en.wikipedia.org/wiki/Network_Time_Protocol

    In one project I'm going to use NTP (tomorrow i quess), but I already did some research:

    iOS library: https://github.com/jbenet/ios-ntp - Author notes: The implementation is not a rigorous as described in those RFCs since the goal was to improve time accuracy to with in a second, not to fractions of milliseconds.

    For non-commercial project look on: www.packages.ubuntu.com/source/lucid/ntp

    C library: www.hillstone-software.com/hs_ntp_details.htm

    Documentation: www.nist.gov/pml/div688/grp40/its.cfm

提交回复
热议问题