简体   繁体   English

目标C处理器计时器

[英]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 to execute the script exist ? 但这无关紧要,因为它可能取决于在后台工作的OS等。是否存在真正可以衡量执行脚本所需的处理器周期的内容? Or something equivalent ? 或等效的东西?

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM