NSDate *myBeginDate = [NSDate date];
// 中间是要测试的代码端。
NSTimeInterval begin = [myBeginDate timeIntervalSinceReferenceDate];
NSTimeInterval end = [[NSDate date] timeIntervalSinceReferenceDate];
NSTimeInterval timeInterval = end - begin;
NSLog(@"timeInterval:%f",timeInterval);