1setTimeout(function () {
2 console.log("5 secondes");
3}, 5000);
4console.log("now");
1setInterval(function () {
2 console.log("Every 5 secondes");
3}, 5000);
4console.log("now");
1window.setInterval(function() {
2 // do stuff
3}, 1000); // 1000 milliseconds (1 second)
1var intervalID = setInterval(alert, 1000); // Will alert every second.
2// clearInterval(intervalID); // Will clear the timer.
3
4setTimeout(alert, 1000); // Will alert once, after a second.
5setInterval(function(){
6 console.log("Oooo Yeaaa!");
7}, 2000);//run this thang every 2 seconds