Measuring execution time.
How do I in Crossworks measure execution time of a function? Is this feature supported in Crossworks?
I have used the feature on Keil uvision and would like to know if it exists under crossworks.
-
Suggestion: if you don't want to (or can't) write specific code for the purpose, you can use the cycles counter (bottom right in the page, during debug).

Set a break point when calling function, check the counter's value and then check it again when leaving function. Then divide by clock frequency and there you are.
You can also reset the counter when entering (Target->Zero Cycle Counter).
-
Crossworks supports ITM/ETM/MTB and can also do PC sample based profiling. Check Trace options from solution/project settings (Target Trace / Trace Interface Type).
Also, when debugging, open Execution Trace / Execution Profile windows (Ctrl+T T; Ctrl+T P).
Of course, notice that if you are running RTOS, your functions might be constantly interrupted by systick / task switching.
Please sign in to leave a comment.
Comments
5 comments