Created
December 18, 2010 12:31
-
-
Save xk/746466 to your computer and use it in GitHub Desktop.
debugger.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2010-12-16 jorge@jorgechamorro.com | |
// loopFreq.js displays event loop tick period in ms and KHz | |
// with debugger; slows down to a crawl ! | |
var k_ms= 1e3; | |
setTimeout(function display () { | |
t= Date.now()-t; | |
console.log(["ctr: ",ctr, ", t:", t, "ms -> ", (ctr/t).toFixed(2), "KHz"].join('')); | |
setTimeout(display, k_ms); | |
ctr= 0; | |
t= Date.now()+ 2; | |
while (t > Date.now()) ; //get in sync with clock | |
}, k_ms); | |
var ctr= 0; | |
var t= Date.now()+ 2; | |
while (t > Date.now()) ; //get in sync with clock | |
(function foo () { | |
debugger; // this is the problem ! | |
process.nextTick(foo); | |
ctr++; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment