1 var testFunction=function(){ 2 console.log("guoyansi"); 3 } 4 var timer=setInterval(testFunction,1000); 5 timer.unref();//取消setTimeout和setInterval函數的調用 6 timer.ref();//恢復setTimeout和setInterval函數的調用
1 var testFunction=function(){ 2 console.log("guoyansi"); 3 } 4 var timer=setInterval(testFunction,1000); 5 timer.unref();//取消setTimeout和setInterval函數的調用 6 timer.ref();//恢復setTimeout和setInterval函數的調用