Skip to content

Instantly share code, notes, and snippets.

@voigt
Created April 20, 2013 08:41
Show Gist options
  • Save voigt/5425279 to your computer and use it in GitHub Desktop.
Save voigt/5425279 to your computer and use it in GitHub Desktop.
Get a benchmark time for a function
while (true) {
var start = Date.now();
benchmark();
var duration = Date.now() - start;
console.log(duration);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment