MKM34Z256VLx7 Bare Metal Software Drivers  R4.1.6
Reference Manual
SYST Software Execution Measurement

This example shows use of the System Timer (SYST) module for software execution measurement.

Source code:
/******************************************************************************
* (c) Copyright 2010-2015, Freescale Semiconductor Inc.
* ALL RIGHTS RESERVED.
******************************************************************************
* systmsr_test.c
******************************************************************************/
#include "drivers.h"
static uint32 volatile ticks;
void main (void)
{
/* initialize system Timer */
/* clear system Timer */
NOP();
NOP();
NOP();
/* read value from the system Timer */
ticks = SYST_GetCntrVal (); /* ticks = 3 core clock cycles */
while(1);
}
Toolchain support:
IAR EWARM 7.40.7KEIL uVision 5.15CrossWorks 3.6ATOLLIC TrueStudio 5.3.0Kinetis Design Studio 3.0.0