Created
February 5, 2018 17:37
-
-
Save gersongoulart/1a4673ee4bc7f93e84d5bd3b4a47ac00 to your computer and use it in GitHub Desktop.
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
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