MEASURING EXECUTION TIME
Applies to: uVision Debugger
Information in this article applies to:
How can I measure the length of time it takes to execute several
lines of code using uVision?
This is very simple to achieve, however note that if your code is
not very simple, then the execution time may differ slightly every
time the code is executed. The Performance Analyzer may be
used to find an average execution time for a function, so placing
your code in a function in order to measure it may be another route
Set the clock frequency. Choose Options for Target from
the Project menu and click on the Target tab. Enter the
clock frequency into the Clock text box.
Start a debug session and set breakpoints at the start and end
of the code you wish to time.
Run to the first breakpoint and make a note of the 'secs' item
in the register window. This is the execution time in seconds up to
Run to the second breakpoint and make a note of the 'secs'
Calculate the difference in seconds between the breakpoints to
obtain your execution time.
Refer to page 69 in the Getting
Started and Creating Applications manual (07.99) for more
information on setting breakpoints.
Refer to page 76 in the Getting Started and Creating
Applications manual (07.99) for more information on the Performance
Article last edited on: 2005-08-03 13:20:08
Rate this article
Disagree? Move your mouse over the bar and click