A Promise then callback runs from the microtask queue after synchronous code completes. A timer callback enters a later task, so scheduling both in one turn does not make them run together.
A long chain that keeps adding microtasks can delay later tasks and rendering. The demo shows the order of three jobs scheduled together.
When to use
Use it to reason about async output order and delayed UI updates.