Last active
August 29, 2015 14:00
-
-
Save gasolin/11021583 to your computer and use it in GitHub Desktop.
collecting js function performance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from the book
Secrets of the JavaScript Ninja
Sec 1.4.2