how to pause timer or freeze it and resume -> javascript

后端 未结 1 1903
不知归路
不知归路 2020-12-21 20:28

I am doing a little app in javascript that has some timers around. At some point I need to change the variables that a single timer is using during runtime.

I tried

相关标签:
1条回答
  • 2020-12-21 21:07
    var t1;
    t1 =setTimeout("dosomethig",1000) //1000 = 1 sec
    
    clearTimeout(t1); // to release timeout
    
    0 讨论(0)
提交回复
热议问题