Google News
logo
NodeJS - Interview Questions
Highlight the differences between process.nextTick() and setImmediate().
Both process.nextTick() and setImmediate() are functions of the Timers module, but the difference lies in their execution.
 
The process.nextTick() function waits for the execution of action till the next pass around in the event loop or when the event loop culminates, then only the callback function is invoked.

The setImmediate() function is used for callback method execution on the next cycle of the event loop, which returns it to the event loop for the execution of the input/output operations.
Advertisement