timestop
1.0.0
필요한 경우 설정 타임 아웃을 일시 중지하십시오.
디버깅 시간에 중단 점을 확인하는 동안 'Settimeout'으로 인한 시간 초과를 방지하기 위해 'Settimeout'을 일시 중지하려는 상황에서 유용 할 수 있습니다.
// Require it in Node.js or include it with <script src='timestop.js'> in
// browsers before any 'setTimeout' you want to be affected.
// in Node.js (it will attach 'timestop' object to window if in browsers)
var timestop = require('timestop')
var start = new Date;
setTimeout(function() {
console.log(new Date - start) // should be about 1500
}, 1000)
// all the affected 'setTimeout' will be paused
timestop.pause()
// .. assume 500ms elapsed.
// all the affected 'setTimeout' will be resumed.
timestop.resume()