Last active
August 19, 2018 17:13
-
-
Save ivanbtrujillo/eeee4831324187fea7010e3524d575f4 to your computer and use it in GitHub Desktop.
Performance test of a given function
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
var perf = function(testName, fn) { | |
var startTime = new Date().getTime(); | |
fn(); | |
var endTime = new Date().getTime(); | |
console.log(testName + ": " + (endTime - startTime) + "ms"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment