Skip to content

Instantly share code, notes, and snippets.

@kylebarrow
Created December 26, 2011 04:06
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 kylebarrow/1520505 to your computer and use it in GitHub Desktop.
Save kylebarrow/1520505 to your computer and use it in GitHub Desktop.
JavaScript perf testing loop
var start = new Date();
var count = 1000000;
while(count > 0)
{
// JS to perf test here
count--;
}
var end = new Date();
console.log("Duration: " + (end-start) + " ms");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment