Visualizer
Event Loop Simulator
Step through real Node.js execution and watch how the call stack, process.nextTick, microtasks, timers, and setImmediate interact to determine output order.
step 0 / 12
index.js
1console.log('start');
2setTimeout(() => console.log('timeout'), 0);
3setImmediate(() => console.log('immediate'));
4Promise.resolve().then(() => console.log('promise'));
5process.nextTick(() => console.log('nextTick'));
6console.log('end');
console
no output yet
Press Play or step forward to begin executing the program.
Call Stack
LIFO — runs nowempty
nextTick Queue
highest priorityempty
Microtask Queue
promisesempty
Timers Queue
setTimeout / setIntervalempty
Check Queue
setImmediateempty
Event Looptimers → poll → check
Execution priority cheat sheet
1
Synchronous code
the whole script, top to bottom
2
process.nextTick
Node-specific, before promises
3
Microtasks
Promise.then / catch / finally
4
Timers
setTimeout, setInterval
5
setImmediate
check phase, after I/O