Question

Now that it's clear that the Cortex-A8 performance counters aren't available on the iPhone/iPad (they need to be explicitly enabled for usermode, which Apple hasn't done), is there some other way of getting a reasonable cycle count on iOS devices, for micro-profiling?

Was it helpful?

Solution

The most fine grain timing available to iOS user code via a public API appears to be using mach_absolute_time(), from mach/mach_time.h, whose output appears to scaled results from one of the ASIC's clock cycle counters. Call it one extra time just before you start timing to pre-fill the ICACHE with the mach_time library code. Note that some of Apple's ASICs may shift gears for the app's CPU core clock speed, depending.

OTHER TIPS

I might be completely off, but is CFAbsoluteTimeGetCurrent too coarse for you?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top