[英]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 谢谢
Shark might help you. 鲨鱼可能会帮助您。 Guide for iPhone: http://rudifa.wordpress.com/2009/09/16/profiling-an-iphone-application-with-shark/ 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? 更多信息: 为什么Xcode中的“运行>使用性能工具运行> Shark”始终是灰色的? How to call that? 怎么称呼它?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.