Created
November 30, 2011 14:57
-
-
Save nefarioustim/1409341 to your computer and use it in GitHub Desktop.
Homespun JavaScript profiling
This file contains hidden or 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
for ( | |
var start = new Date().getTime(), | |
iterationCount = 0, | |
millisec = 0; | |
millisec < 1000; | |
iterationCount++ | |
) { | |
// Your profiled code | |
// goes here | |
millisec = new Date().getTime() - start; | |
} | |
// iterationCount tells you how it performed | |
// in comparison to something else. | |
// The higher the number, the better! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment