How to make time intervals in JavaScript
Can someone please help me and explain how I can make time intervals in a JavaScript project?
Can someone please help me and explain how I can make time intervals in a JavaScript project?
You do this:
setInterval(function() {
//your code
}, 1000);
This will run the function every time 1000 milliseconds (1 second) has past.
You can also first create a function (i.e. doThis() ) and write it like this instead:
setInterval(doThis, 1000);
Влезте в услугата, за да оставите коментар.