Interrupt Latency Calculator — worst-case response time

Worst-case interrupt response from clock speed, cycle counts and priority nesting.

Example: Worst-case interrupt latency is 7.278 µs — 524 cycles at 72 MHz, mostly higher-priority interrupts.

Check it against real silicon

Chiprun runs your firmware on an emulated microcontroller and hands back the UART output, so you can confirm these numbers rather than trusting them.

Chiprun docs

Formula

latency = entry + longest critical section + higher-priority ISR time

Worked example

Worst-case interrupt latency is 7.278 µs — 524 cycles at 72 MHz, mostly higher-priority interrupts.

  1. entry latency (fixed by the core)

    12 cycles on Cortex-M3/M4

    166.7 ns

  2. blocking = critical section + n × (ISR + tail-chain)

    200 + 2 × (150 + 6)

    512 cycles

  3. latency = (entry + blocking) / f_clk

    524 / 72 MHz

    7.278 µs

Frequently asked questions

What actually determines interrupt latency?

Rarely the core. Hardware entry is 12 cycles on a Cortex-M3 — well under a microsecond at any sensible clock. What dominates is blocking: the longest region with interrupts disabled, plus any higher-priority handler that runs first.

How do I reduce interrupt latency?

Find and shorten the longest critical section. It is often inside a library — a malloc implementation, a driver, an RTOS call — rather than your own code. After that, shorten high-priority handlers, deferring work to a task or a lower-priority interrupt.

What is tail-chaining?

When one interrupt is pending as another finishes, Cortex-M cores skip the stack pop and push and go straight to the next handler. It saves roughly half the entry cost, which is why back-to-back interrupts are cheaper than two isolated ones.

Why is my measured latency worse than this calculation?

On cached cores, usually a cache miss — the vector table or handler code not being resident adds cycles that no static calculation captures. Flash wait states and bus contention with DMA do the same. Measure with a GPIO toggle and a scope over a long run.

Related tools