js之定时器、延时器用法

定时器: this.checkTimer = setInterval(this.checkDayAndNight, 2* 60000);   

清除定时器  clearInterval(this.checkTimer);

延时器:
 setTimeout(()=>{
dispatch({
type: 'commandbyhead/getPoliceCaseCount',
payload: {}
});}, 4*1000);
posted @ 2021-03-26 13:50  zhulin1028  阅读(652)  评论(0)    收藏  举报