Skip to content

Instantly share code, notes, and snippets.

@zimbatm
Created October 4, 2010 21:37
Show Gist options
  • Save zimbatm/610485 to your computer and use it in GitHub Desktop.
Save zimbatm/610485 to your computer and use it in GitHub Desktop.
ev_now tests
undefined
------
previous: undefined
current: Mon, 04 Oct 2010 21:32:26 GMT
diff: 0
------
previous: Mon, 04 Oct 2010 21:32:26 GMT
current: Mon, 04 Oct 2010 21:32:27 GMT
diff: 1
------
previous: Mon, 04 Oct 2010 21:32:27 GMT
current: Mon, 04 Oct 2010 21:32:28 GMT
diff: 0
------
previous: Mon, 04 Oct 2010 21:32:28 GMT
current: Mon, 04 Oct 2010 21:32:29 GMT
diff: 0
------
previous: Mon, 04 Oct 2010 21:32:29 GMT
current: Mon, 04 Oct 2010 21:32:30 GMT
diff: 0
Mon, 04 Oct 2010 21:31:31 GMT
------
previous: undefined
current: Mon, 04 Oct 2010 21:31:31 GMT
diff: 1000
------
previous: Mon, 04 Oct 2010 21:31:31 GMT
current: Mon, 04 Oct 2010 21:31:32 GMT
diff: 1000
------
previous: Mon, 04 Oct 2010 21:31:32 GMT
current: Mon, 04 Oct 2010 21:31:33 GMT
diff: 1000
------
previous: Mon, 04 Oct 2010 21:31:33 GMT
current: Mon, 04 Oct 2010 21:31:34 GMT
diff: 1000
------
previous: Mon, 04 Oct 2010 21:31:34 GMT
current: Mon, 04 Oct 2010 21:31:35 GMT
diff: 1000
------
previous: Mon, 04 Oct 2010 21:31:35 GMT
current: Mon, 04 Oct 2010 21:31:37 GMT
diff: 0
------
previous: Mon, 04 Oct 2010 21:31:37 GMT
current: Mon, 04 Oct 2010 21:31:37 GMT
diff: 996
------
previous: Mon, 04 Oct 2010 21:31:37 GMT
current: Mon, 04 Oct 2010 21:31:38 GMT
diff: 1000
------
previous: Mon, 04 Oct 2010 21:31:38 GMT
current: Mon, 04 Oct 2010 21:31:39 GMT
diff: 1000
var sys = require('sys'), old;
sys.puts(sys.inspect(process.loopTime));
setInterval(function() {
var now = Date.now();
sys.puts("------");
sys.puts("previous: " + sys.inspect(old));
sys.puts("current: " + sys.inspect(process.loopTime));
sys.puts("diff: " + (now - process.loopTime));
old = process.loopTime;
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment