【发布时间】:2011-10-01 03:28:42
【问题描述】:
现在很明显the Cortex-A8 performance counters aren't available on the iPhone/iPad(它们需要为用户模式显式启用,Apple 尚未这样做),是否有其他方法可以在 iOS 设备上获得合理的循环计数,用于微分析?
【问题讨论】:
标签: iphone ios ipad profiling cortex-a8
现在很明显the Cortex-A8 performance counters aren't available on the iPhone/iPad(它们需要为用户模式显式启用,Apple 尚未这样做),是否有其他方法可以在 iOS 设备上获得合理的循环计数,用于微分析?
【问题讨论】:
标签: iphone ios ipad profiling cortex-a8
iOS 用户代码通过公共 API 可用的最精细的时序似乎是使用 mach/mach_time.h 中的 mach_absolute_time(),其输出似乎是 ASIC 时钟周期计数器之一的缩放结果。在开始计时之前再调用一次,以使用 mach_time 库代码预填充 ICACHE。请注意,Apple 的一些 ASIC 可能会根据应用的 CPU 核心时钟速度进行调整,具体取决于。
【讨论】:
我可能完全不在了,但CFAbsoluteTimeGetCurrent 对你来说太粗俗了吗?
【讨论】: