Scheduling the timer before the work
schedule after
burn(6)
then
setTimeout(step, 0)
work
6
ms
wait
4.5
ms
work
6
ms
wait
4.5
ms
work
6
ms
wait
4.5
ms
31.5ms
schedule first
setTimeout(step, 0)
then
burn(6)
work
6
ms
work
6
ms
work
6
ms
wait
4.5
ms
wait
4.5
ms
wait
4.5
ms
18ms
0ms
10
20
30
The work is identical in both lanes. Only the waiting moved: in the second, each timer's delay elapses underneath the chunk that was going to run anyway.
Three chunks, drawn to scale against the axis, using the measured 4.5ms clamp.