iOS.GetCurrentTimestamp
The Methods to Get Current Timestamp
A. CACurrentMediaTime()
B. gettimeofday
C. CFAbsoluteTimeGetCurrent
D. [NSDate date] timeIntervalSince1970]
E. mach_absolute_time()
Clock Time:
CFAbsoluteTimeGetCurrent [NSDate timeIntervalSinceReferenceDate] return clock time.
Clock time is synchronized with the network time signal. So, they are not suitable for timestamp.
Todo:
1. How to convert mach_absolute_time() into seconds?
Reference:
1. http://stackoverflow.com/questions/358207/iphone-how-to-get-current-milliseconds
2. http://www.alexcurylo.com/blog/2009/09/05/tip-cacurrentmediatime/
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。