开发者

Objective C processor timer

开发者 https://www.devze.com 2023-01-11 09:14 出处:网络
I would like to compare the real efficiency of different scripts. I currently use a timer : NSDate *start = [NSDate date];

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消