码迷,mamicode.com
首页 > 移动开发 > 详细

关于iOS中的时间

时间:2016-09-28 01:31:27      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:

两类

  1. 绝对时间
    [NSDate date]CFAbsoluteTimeGetCurrent(),或者gettimeofday()。 返回的是从某一个时刻开始,度过的秒数。会随着用户设置的系统时间更改。
  2. 相对时间
    CACurrentMediaTime 或者-[NSProcessInfo systemUptime],相对时间。重启之后,会重新计数。

参考资料

  1. Keeping Track of Time Passed on iOS
  2. NSDate 、CFAbsoluteTimeGetCurrent、CACurrentMediaTime 的区别
  3. Benchmarking

关于iOS中的时间

标签:

原文地址:http://www.cnblogs.com/huahuahu/p/guan-yuiOS-zhong-de-shi-jian.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!