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

Do I calculate code execution time in the right way?

I debug program for ADUC7026 in uVision IDE using simulator.
I have simple C code for Timer0 IRQ Handler as following:

void IRQ_Handler() __irq
{
 if (IRQSIG & RTOS_TIMER_BIT)
  {
   if (btn_delay) btn_delay--;
   if (hl_delay) hl_delay--;
   T0CLRI = 0x1;
  }
}

In Disassembly window I see that code translated into about 20 instructions. If ADUC have core clock frequency 41.76 MHz, one clock is about 25 ns and this code is 20x25=500 ns long (if all instructions are 1 clock long, I have not found any info about ARM instructions length). Plus interrupt latency about 20...30 clock. So total time is about 1 us. But in Performance Analyzer Window I see the execution time for that handler 3 us!!! Why so?

Parents Reply Children