EC-20.1 Real Time as a Requirement: Deadlines, Latency and Jitter
The standard opening treatment of real-time requirements: deadlines, latency, jitter and worst-case execution time, September 2026
What this is and why it exists
Most embedded arguments about speed are really arguments about timing, and the two are not the same thing.
A system that answers in one millisecond almost always, and in forty milliseconds once an hour, is not slow. It is unpredictable. A faster processor does not fix it, because the problem is the structure of the software rather than the speed of the machine.
This topic exists to turn "fast enough" into a number somebody else can test. Everything later in this module is a technique for meeting a requirement, and none of it means anything until the requirement is written down.
The vocabulary
- Deadline — the latest moment at which a response is still useful.
- Hard deadline — one whose miss is a failure of the system.
- Soft deadline — one whose miss degrades the result without breaking it.
- Latency — the time between an event and the response to it.
- Jitter — the variation in that time from one occasion to the next.
- Worst-case execution time — the longest a piece of code can take to run.
- Periodic task — work that arrives at a fixed interval.
- Sporadic task — work that arrives irregularly, with a known minimum gap.
- Superloop — a single endless loop that calls every piece of work in turn.
The mental model
Think of a timing requirement as three things written together: an event, a deadline, and a consequence.
The event is what starts the clock. A button is pressed, a sample is ready, a message arrives. If you cannot point at the event, you do not have a requirement yet.
The deadline is a number with a unit. Ten milliseconds. Two hundred microseconds. It is not "quickly" and it is not "before the user notices", because neither of those can be measured on a bench.
The consequence is what happens on a miss, and it is the part that is usually left out. A dropped frame in a display is nothing. A dropped sample in a motor controller can burn a winding. The same code is correct in the first system and dangerous in the second. The consequence is what decides how much effort the deadline deserves.
Once the requirement exists, two measurements matter. Latency is the straightforward one to measure. Set a pin high when the event arrives, set it low when the response completes, and look at the pin. Jitter is the distribution of that time, and it is what actually breaks systems.
The reason is worst-case execution time. Caches, interrupts and loops whose length depends on the data all make the longest run much longer than the usual one. A system sized on the average works nearly always, which is the worst possible failure mode. It fails rarely, unpredictably, and in the field.
The superloop is where most people start, and it works until one of two things happens. Either a piece of work becomes long, or a deadline becomes short. The first symptom is a response time that grows whenever an unrelated feature is added. That symptom means the structure is wrong, not the code, and the answer is a scheduler.
What you should now be able to explain or do
- Write a timing requirement with an event, a deadline in milliseconds, and a consequence.
- Distinguish latency from jitter, and say why jitter is usually the more dangerous of the two.
- Measure both on real hardware with a spare pin and an oscilloscope.
- Explain why the worst-case execution time matters and the average does not.
- Recognise the symptom that says a superloop has run out.
- Classify a piece of work as periodic, aperiodic or sporadic, and say why the label matters.
Check yourself
What is wrong with the requirement "the display must update quickly"?
Nothing in it can be tested. It names no event, gives no number, and says nothing about what happens if the update is late.
Why does a faster processor not fix a jitter problem?
Because jitter comes from work being blocked by other work. Making everything faster shortens the delays without removing the variation that causes them.
Why is a system sized on average execution time a bad idea?
Because it meets its deadline nearly always and fails occasionally. Rare, unpredictable failures are far harder to diagnose than a system that never works.
What is the first sign that a superloop is no longer enough?
The response time to one event starts growing when an unrelated feature is added. That means the loop, rather than the code, is the constraint.
Go deeper
We haven't checked most of these for screen reader use yet.
Back to Real Time as a Requirement: Deadlines, Latency and Jitter: work through the checklist