Last active
July 28, 2016 09:00
-
-
Save t27/ce9d41fdb2881f75208838b7693f9bf4 to your computer and use it in GitHub Desktop.
TI Tiva launchpad measure function time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SysTickPeriodSet(80000000); // The period should be equal to the system clock time to ensure the systick values are in clock cycle units | |
| SysTickEnable(); | |
| while(1) { | |
| t1 = SysTickValueGet(); // clock cycles | |
| a = pe -> getPosition(); | |
| t2 = SysTickValueGet(); // clock cycles | |
| time = (t1 - t2); // difference measured in clock cycles | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment