iOS: How to measure passed time, independent of clock and time zone changes?

前端 未结 2 633
挽巷
挽巷 2021-01-16 15:03

In order to measure the time duration while my app is running, as well as the time that passed while my app was idle in the background, I need a reference clock that is not

2条回答
  •  爱一瞬间的悲伤
    2021-01-16 16:07

    #include into your source file.

    replace any calls to clock_gettime(CLOCK_MONOTONIC, ×pec_t) with calls to mach_absolute_time().

提交回复
热议问题