关于iOS中的时间
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于iOS中的时间相关的知识,希望对你有一定的参考价值。
两类
- 绝对时间
[NSDate date]
、CFAbsoluteTimeGetCurrent()
,或者gettimeofday()
。 返回的是从某一个时刻开始,度过的秒数。会随着用户设置的系统时间更改。 - 相对时间
CACurrentMediaTime
或者-[NSProcessInfo systemUptime]
,相对时间。重启之后,会重新计数。
参考资料
- Keeping Track of Time Passed on iOS
- NSDate 、CFAbsoluteTimeGetCurrent、CACurrentMediaTime 的区别
- Benchmarking
以上是关于关于iOS中的时间的主要内容,如果未能解决你的问题,请参考以下文章
如何将片段中的 ListView 对象的数据传递给 Activity?