Repeating setTimeout

前端 未结 7 857
太阳男子
太阳男子 2020-12-15 15:56

I am trying to repeat setTimeout every 10 seconds. I know that setTimeout by default only waits and then performs an action one time. How can I rep

7条回答
  •  温柔的废话
    2020-12-15 16:17

    according to me setInterval() is the best way in your case.
    here is some code :

     setInterval(function() {
    
    //your code
    
    }, 10000); 
    // you can change your delay by changing this value "10000".
    

提交回复
热议问题