Last active
April 11, 2019 09:08
-
-
Save jportella93/bed494b74bd01349c0a191f134813618 to your computer and use it in GitHub Desktop.
Calculating performance of an action on a browser console.
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 testPerformance(fn, iterations) { | |
console.time() | |
for (let i = 0; i < iterations; i++) { | |
fn() | |
}; | |
console.timeEnd() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment