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

iOS.GetCurrentTimestamp

时间:2014-07-02 23:53:15      阅读:443      评论:0      收藏:0      [点我收藏+]

标签:blog   http   os   for   io   amp   

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/

iOS.GetCurrentTimestamp,布布扣,bubuko.com

iOS.GetCurrentTimestamp

标签:blog   http   os   for   io   amp   

原文地址:http://www.cnblogs.com/cwgk/p/3818853.html

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