Node.js - Timers and Scheduling
What is the main difference between
setInterval and recursive setTimeout in Node.js?setInterval and recursive setTimeout in Node.js?setInterval behaviorsetInterval schedules a function to run repeatedly at fixed time intervals without waiting for the previous run to finish.setTimeout behaviorsetTimeout schedules the next run only after the current function completes, avoiding overlap.setInterval runs tasks at fixed intervals regardless of task duration, recursive setTimeout waits for the task to finish before scheduling the next. -> Option B15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions