The timer clamp counts depth, not breadth
breadth
Siblings from one task
setTimeout(a, 0) ×12
ordinary tasklevel 0
timer0ms
timer0ms
timer0ms
12 of these fired inside 0.3ms total.
depth
Each timer schedules the next
function tick(){ setTimeout(tick, 0) }
ordinary tasklevel 0
timerlevels 1–6 · 0ms
timerlevel 7+ · ~4.5ms
…and every one after it
Any self-rescheduling loop is this shape, even when it reads as flat.
Hover any box. Both columns schedule with setTimeout(fn, 0); only the chain gets clamped.
Gaps measured between consecutive callbacks in Chrome 153.