How to get NSTimeInterval value from last boot

前端 未结 3 377
一整个雨季
一整个雨季 2020-12-19 09:35

I need to get NSTimeInterval value from last device boot. I found CACurrentMediaTime() which suits this task, but in my app I am not using Core Animation and I don\'t think

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-19 09:50

    The NSTimeInterval value since the last system restart can be acquired more directly via the following Foundation object and method:

    [[NSProcessInfo processInfo] systemUptime]

提交回复
热议问题