CFAbsoluteTime profile_start = CFAbsoluteTimeGetCurrent(); for(int i = 0; i < 100000; i++) CFAbsoluteTimeGetCurrent(); NSLog(@"direct C call: %0.5f", CFAbsoluteTimeGetCurrent() - profile_start); profile_start = CFAbsoluteTimeGetCurrent(); for(int i = 0; i < 100000; i++) [NSDate date]; NSLog(@"NSDate call: %0.5f", CFAbsoluteTimeGetCurrent() - profile_start);
The output is;
direct C call: 0.01097 NSDate call: 0.05005
No comments:
Post a Comment