Skip to content

Instantly share code, notes, and snippets.

@spion
Created August 14, 2014 12:09
Show Gist options
  • Save spion/9e382999346c0880f1b1 to your computer and use it in GitHub Desktop.
Save spion/9e382999346c0880f1b1 to your computer and use it in GitHub Desktop.
var Timer = process.binding('timer_wrap').Timer;
function test(r) {
return function() {
console.log(r, Timer.now());
}
}
function run() {
for (var k = 0; k < 10; ++k) {
var r = Math.random() * 10;
setTimeout(test(r), r)
}
}
setInterval(run, 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment