ARM Technical Support Knowledge Articles

MEASURING EXECUTION TIME

Applies to: uVision Debugger

Answer


Information in this article applies to:


QUESTION

How can I measure the length of time it takes to execute several lines of code using uVision?

ANSWER

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 to take.

  1. 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.
  2. Start a debug session and set breakpoints at the start and end of the code you wish to time.
  3. 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 the breakpoint.
  4. Run to the second breakpoint and make a note of the 'secs' item.
  5. Calculate the difference in seconds between the breakpoints to obtain your execution time.

MORE INFORMATION

Article last edited on: 2005-08-03 13:20:08

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential