Objective C processor timer
I would like to compare the real efficiency of different scripts. I currently use a timer :
NSDate *start = [NSDate date];
// Do something
NSLog(@"Elapsed : %f",[start timeIntervalSinceNow]);
But it is not relevant since it might depend on the OS working in the background, etc... Does something that really measure the processor cycles needed开发者_如何学C to execute the script exist ? Or something equivalent ?
Thanks
Shark might help you. Guide for iPhone: http://rudifa.wordpress.com/2009/09/16/profiling-an-iphone-application-with-shark/
More info: Why is "Run > Run with Performance Tool > Shark" always gray in Xcode? How to call that?
精彩评论