I need a (hopefully) simple timer. BUT I'd prefer not to use an hardware timer.
I explain. I need to measure if a time interval elapsed. My ideal piece of code will be something that gives me the clock ticks since the power on and then divides them by the clock frequency.
In plain old C I'd write
clock_t tmr = clock();
int elapsed_ms = (clock()- tmr*1000)*/CLOCKS_PER_SEC;
But... In Kinetis Design Studio (Processor Expert project, so no C++, and no RTOS) the "clock" function returns always 0 and CLOCKS_PER_SEC is equal to 100.
Do you know if there is something I can use? As already stated I'd prefer not to use some hardware timers, because this is just a part of the program and I'd like to limit interferences with other parts.
BTW... I'm using a FRDM-K64F board