Calling a function every 60 seconds

后端 未结 13 2098
情书的邮戳
情书的邮戳 2020-11-22 08:24

Using setTimeout() it is possible to launch a function at a specified time:

setTimeout(function, 60000);

But what if I would l

13条回答
  •  忘了有多久
    2020-11-22 09:22

    here we console natural number 0 to ......n (next number print in console every 60 sec.) , using setInterval()

    var count = 0;
    function abc(){
        count ++;
        console.log(count);
    }
    setInterval(abc,60*1000);
    

提交回复
热议问题