You could place a timer, start it before the f() call, then
stop and read it after f() return would be one way.
A more exact method is count the code cycles in the ASM listing, .LST file
in the workspace result tab.
Okay thanks but I don't understand something,
if I put a clock of 24MHZ on the timer with a period of 256 (10,667µS) , when I stop the timer in my function,how can I have the time? I will get the counter value of the timer
The timer is a down counter starting at its period value.
When started it starts counting down, and when you stop
it, the value (period - counter value) X input clock period = time
You could use an up counter, and accomplish the same
thing ithout the subtract math.