Calculate the time the code runs.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User13396
Level 5
Level 5
Dear sir
I use Infineon TC1782 and my complier is TASKING.
In my Application. I need to Calculate the time the code runs. so i find the introduction in the help contents.it say Select C/C++ Compiler>Debugging and Enable Static profiling.

In the help document:
Menu entey
1.Select C/C++Compiler> Debugging
2.Enable or disable Static profiling
3.Enable or disbale one or more of the following Gen......
for ......
for function times
4.optionally,when you selected function timers,

i have try my best,but i can't achieve the result.

So I will ask below question
1:Can it Calculate the time the code runs?
2:how do i do?for know the time the code runs.
0 Likes
1 Reply
Not applicable
Hi sangyangyang,

for just measuring one function I would recommend to use the System timer

dt = STM0_TIM0.U;
myfoo();
dt = STM0_TIM0.U - dt;

Cheers, Martin
0 Likes