Skip to content

Instantly share code, notes, and snippets.

@tjfontaine tjfontaine/t.js
Created Aug 28, 2013

Embed
What would you like to do?
24.671734 25.328266 51
51.458482 1.4584819999999965 65
51.172963 1.1729630000000029 53
51.118443 1.1184429999999992 51
51.114316 1.1143160000000023 51
51.125697 1.1256970000000024 51
var Timer = process.binding('timer_wrap').Timer;
var TIMEOUT=50;
var last, lt;
var count = 0;
function blah() {
if (last) {
var hr = process.hrtime(last);
var ms = (hr[0] * 1e3) + (hr[1] / 1e6);
console.log(ms, Math.abs(TIMEOUT - ms), Timer.now() - lt);
if (count > 5)
process.exit();
}
last = process.hrtime();
lt = Timer.now();
setTimeout(blah, TIMEOUT);
count++;
}
//setTimeout(function() {
//setImmediate(function() {
blah();
//});
//}, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.