Skip to content

Instantly share code, notes, and snippets.

@gasolin
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gasolin/11021583 to your computer and use it in GitHub Desktop.
Save gasolin/11021583 to your computer and use it in GitHub Desktop.
collecting js function performance
var start = new Date().getTime();
for (var n = 0; n < maxCount; n++) {
/* perform the operation to be measured *//
}
var elapsed = new Date().getTime() - start;
console.log('Measured time: ' + elapsed);
@gasolin
Copy link
Author

gasolin commented Apr 18, 2014

from the book Secrets of the JavaScript Ninja Sec 1.4.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment