Node.js Timer API. setTimeout, setInterval, setImmediate and how to cancel a timer

preview_player
Показать описание

Node tutorial for beginners. This video talks about:
- how to start a timer?
- how to cancel a timer?
- use setTimeout, setInterval and setImmediate functions
- use clearTimeout, clearInterval and clearImmediate to cancel Timer

.
Please donate and support my work
(If you think my free tutorials are better than paid ones :)

Free Programming courses:

Free Flutter course:

Free Android courses:

More free programming courses:

Check out my website:

Let's get in touch! [Sriyank Siddhartha]

---- Thank you for your love and support ----
Рекомендации по теме
Комментарии
Автор

Hello, I am trying to run my script every one second using SetInterval(). At the beginning my script needs like 50 seconds (So my script should run multiple times, because it starts every one second). If I check duration after 2 hours, my script needs 3000 seconds to run, so way longer. Why does this happen?

danis
Автор

Hi i have one doubt

setTimeout(function(){


    console.log("3 sec have pass")



}, 3000);



setTimeout(() => {
    console.log('Hello after 4 seconds')
}, 3000);

so can we simply use node js. (function) inside of (=>) ?

sivasham
Автор

Hi. thank you. you source code very helpful. and your explanation video good. keep going on

sivasham
Автор

How to use async and await along with settimeout ?

itrocker
Автор

in my node express app setInterval not working in bckground on heroku ..please tell me why ?

maheshmahadar
Автор

Hello Sir, I am learning retrofit from your course, but I facing a problem, when I am running the app in my phone, it shows error of "java.net socket timeout exception: fail to connect the localhost". What to do ??

askdetanny