Home / Learn Embedded C / Interrupt Latency Explained
Interrupt Latency Explained
The delay between a hardware event occurring and its ISR actually starting to run.
Theory in plain words
In plain terms
Interrupt latency is the time between the triggering hardware event and the first instruction of its ISR actually executing — never zero, due to detection time, any higher-priority work in progress, and the CPU's own state-saving overhead.
Why we use it
Hard real-time applications (some motor control, some safety systems) need to know the worst-case interrupt latency, not just the typical case, to guarantee a response within a required time budget.
Under the hood
Latency is affected by whether interrupts are currently disabled (e.g. inside a critical section), whether a higher or equal priority ISR is already running, and the fixed overhead of the CPU's own state-save sequence before jumping to the handler.
Real-world use
- Hard real-time response guarantees
- Motor control timing budgets
- Safety-critical response analysis
Try it
A hard real-time design must budget for this worst-case figure, not just the typical, usually much shorter, latency.
Try it: a critical section adding to the worst-case latency
An interrupt that fires while a critical section is active must wait for it to finish before the CPU even begins its normal save/jump sequence, adding directly to latency.
Quick quiz
1. What does "interrupt latency" measure?
Latency specifically measures the delay before the handler starts, not how long the handler itself takes to finish.