Hi,
ARM Cortex-M have a DWT (Data Watchpoint and Trace) unit implemented, and it has a nice feature in that unit which counts the execution cycles. The DWT is usually implemented on most Cortex-M3, M4 and M7 devices, including e.g. the NXP S32K14x.
Attachment is the sample project on S32K142 to measure the running time of a function.
Password of extraction is nxp.
Enjoy the measuring!
Cheers!
Oliver
BTW, Measure the running time of one function on PowerPC could also be gotten through the link.