EDIT: Fixed a bug, but still yields the same result.
I tried to use SysTick to time a segment of code, but I am getting an answer that I can tell is wrong. This is what I have done:
SysTickPeriodSet(10000000); SysTickEnable(); uint32_t numCycles = SysTickValueGet(); // time-intensive code runs here numCycles = SysTickValueGet() - numCycles; uint32_t clockRate = SysCtlClockGet();
I then calculate numCycles/clockRate and get 53 seconds as my time, when I can clearly tell that the code is running in less than a second. Am I using SysTick incorrectly/is there a better way to time code on the TM4C123? I need microsecond resolution.
Thanks.