Skip to content

Instantly share code, notes, and snippets.

@nefarioustim
Created November 30, 2011 14:57
Show Gist options
  • Save nefarioustim/1409341 to your computer and use it in GitHub Desktop.
Save nefarioustim/1409341 to your computer and use it in GitHub Desktop.
Homespun JavaScript profiling
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