Skip to content

Instantly share code, notes, and snippets.

@alexbosworth
Created October 7, 2010 06:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexbosworth/614650 to your computer and use it in GitHub Desktop.
Save alexbosworth/614650 to your computer and use it in GitHub Desktop.
a runtime calculator for scripts
// for node-jquery.js (http://gist.github.com/599831)
// add this to a script to show how long it took to complete
process.on('exit', $.proxy(function () {
var sec = Math.round((new Date().getTime() - this.start.getTime()) / 1000);
console.log('completed', 'in ' + sec + ' seconds');
}, {start:new Date()}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment