Skip to content

Instantly share code, notes, and snippets.

@ethertank
Created May 31, 2013 23:45
Show Gist options
  • Save ethertank/5688683 to your computer and use it in GitHub Desktop.
Save ethertank/5688683 to your computer and use it in GitHub Desktop.
function stopWatch (fn, timerName) {
console.log( console.time(timerName) );
fn();
console.log( console.timeEnd(timerName) );
}
/* Usage *//*
function testFn() {
return 10 * 10 * 10;
}
stopWatch(testFn, "test1");
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment