Keil Logo

µVISION DEBUGGER: Measuring Execution Time


Information in this article applies to:

  • C166 Version 4.03 and later

QUESTION

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

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

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

Last Reviewed: Tuesday, February 23, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.