Skip to content

Instantly share code, notes, and snippets.

@gersongoulart
Created February 5, 2018 17:37
Show Gist options
  • Save gersongoulart/1a4673ee4bc7f93e84d5bd3b4a47ac00 to your computer and use it in GitHub Desktop.
Save gersongoulart/1a4673ee4bc7f93e84d5bd3b4a47ac00 to your computer and use it in GitHub Desktop.
function performanceTest(testFunction, iterations = 1000) {
var sum = 0;
var start = performance.now();
for (var i = 0; i < iterations; i++) {
testFunction();
}
var time=performance.now() - start;
console.log(time);
return time;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment