Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created March 21, 2013 18:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save isaacs/5215350 to your computer and use it in GitHub Desktop.
Save isaacs/5215350 to your computer and use it in GitHub Desktop.
var assert = require('assert');
var c = 0;
test();
function test() {
var d1 = Date.now();
setTimeout(function() {
var d2 = Date.now();
var dd = d2 - d1;
assert(dd >= 2, 'expected at least 2, got ' + dd);
++c;
if (c % 1000 === 0)
console.log(c);
test();
}, 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment