From f7354314a7d6cfa8d3a0c3bcb2e09cdba536ea3e Mon Sep 17 00:00:00 2001 From: Joseph Olayanju <49444453+Olayanju-1234@users.noreply.github.com> Date: Fri, 23 Sep 2022 19:10:08 +0100 Subject: [PATCH] Add setInterval content (#1861) * Update 106-set-interval.md * Update content/roadmaps/107-nodejs/content/104-nodejs-async-programming/106-set-interval.md Co-authored-by: Kamran Ahmed --- .../104-nodejs-async-programming/106-set-interval.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/content/roadmaps/107-nodejs/content/104-nodejs-async-programming/106-set-interval.md b/content/roadmaps/107-nodejs/content/104-nodejs-async-programming/106-set-interval.md index e86046842..d67261164 100644 --- a/content/roadmaps/107-nodejs/content/104-nodejs-async-programming/106-set-interval.md +++ b/content/roadmaps/107-nodejs/content/104-nodejs-async-programming/106-set-interval.md @@ -1 +1,9 @@ -# Set interval \ No newline at end of file +# setInterval + +The `setInterval()` method helps us to repeatedly execute a function after a fixed delay. It returns a unique interval ID which can later be used by the `clearInterval()` method, which stops further repeated execution of the function. + +`setInterval()` is similar to setTimeout, with a difference. Instead of running the callback function once, it will run it forever, at the specific time interval you specify (in milliseconds): + +Free Content +Scheduling: setTimeout and setInterval +What is the use of setInterval() method in Node.js?