Timing code

Questions about the BASICtools and MakeItC
Post Reply
YahooArchive
Posts: 1463
Joined: Fri Oct 19, 2012 5:11 am

Timing code

Post by YahooArchive » Sun Feb 10, 2013 9:17 pm

>1. Can I expect a given set of code to consistently take a fixed amount of time
to execute each and every time it executes? If so, can I use the TIMER command
in between the code to be executed to estimate the execution time, and then use
the WAIT command to wait the required amount of time to achieve a desired loop
rate?

Timing code works if there are no interrupts going on, but in the ARM code
timing can vary due to position in Flash because of the memory accelerator.
What this means is that one piece of code in Flash will execute the same each
time, but when you recompile it, it may execute faster or slower because it
moved in Flash. Why not just use the TIMER to set timing, its accurate to 1 uS



Post Reply