ARM Technical Support Knowledge Articles


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


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

Rate this article

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