Low Cycle Counter on iOS Devices

Now that itโ€™s clear that Cortex-A8 performance counters are not available on iPhone / iPad (they should be explicitly allowed for usermode that Apple didnโ€™t do), is there any other way to get a reasonable number of loops on iOS devices for microprofiling?

+4
source share
2 answers

The best grain time available for custom iOS code through the public API seems to use mach_absolute_time (), from mach / mach_time.h, whose output is displayed to scale the results from one of the ASIC clock counters. Call it one extra time just before the start of the count, to pre-populate ICACHE with the library code mach_time. Note that some of the ASIC ASs may shift gears for the application processor core clock, depending.

+3
source

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

+1
source

All Articles