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