Created
March 15, 2018 09:23
-
-
Save nulltier/1b52f0b891b39f2a24563099fc01615f to your computer and use it in GitHub Desktop.
check performance for a sync code
This file contains 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 measureTime (fn) { | |
var start = performance.now(); | |
fn(); | |
return performance.now() - start; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment