CFAbsoluteTimeGetCurrent()
函数能够以毫秒为单位计算当前时间与2001.1.1差值。
- (void)viewDidLoad {
[super viewDidLoad];
CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
// do something
CFAbsoluteTime end = CFAbsoluteTimeGetCurrent();
NSLog(@"%f", end - start);
}