setinterval nodejs code example
Example 1: settimeout node js
setTimeout(function () {
console.log("5 secondes");
}, 5000);
console.log("now");
Example 2: js do every x seconds
window.setInterval(function() {
}, 1000);
Example 3: setinterval nodejs
setInterval(function () {
console.log("Every 5 secondes");
}, 5000);
console.log("now");
Example 4: setinterval vs settimeout js
var intervalID = setInterval(alert, 1000);
setTimeout(alert, 1000);
setInterval(function(){
console.log("Oooo Yeaaa!");
}, 2000);