This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

measuring execution time

I want to evaluate time of function execution in simulator. This function (void abc() for example) is called from external interrupt routine. I have done some tests and got different results:

1 test: On chip. After interrupt occurs, I write 1 to pin, then abc(), and write 0 to pin. So, I can use oscillograph to see real execution time of abc() between pin statement changing. It is about 400mks.

2 test: In Simulator. I wrote endless loop (while(1)) with abc() routine and made measurement with Perfomance Analyzer. It is 470 mks.

3 test: In Simulator. It repeats first test, but i look for time in Register window(Sec) between two breakpoints (before and after abc()). It is about 100 mks.

Processor XC167CI with 32 MHz clock.
Why so different results in measuring?