Execution Time

Hello, I want to determine execution time required for a function which executes when a serial interrupt occurs. I am using Keil C compiler for it. Can anybody tell me procedure for the same.

Regards,
Abhijeet R. Mudgal.

Parents
  • As Christoph suggested, you could count instructions and cycles. Sometimes that is impractical, i.e. when there are too many instructions, too many nested functions, too difficult to account for extra wait states and so on.
    You could also do direct measurement. For example, toggle an external port pin on entry to ISR, toggle it back on exit and use a scope to time it. You could also use a high-resolution on-chip timer if available. Of course, the extra instructions needed for the measurement will distort the result somewhat.

Reply
  • As Christoph suggested, you could count instructions and cycles. Sometimes that is impractical, i.e. when there are too many instructions, too many nested functions, too difficult to account for extra wait states and so on.
    You could also do direct measurement. For example, toggle an external port pin on entry to ISR, toggle it back on exit and use a scope to time it. You could also use a high-resolution on-chip timer if available. Of course, the extra instructions needed for the measurement will distort the result somewhat.

Children
No data
More questions in this forum