Last active
November 13, 2015 16:07
-
-
Save krivaten/9514482 to your computer and use it in GitHub Desktop.
A simple setup for determining how long a block of code takes to execute
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
// Set start time on localStorage | |
localStorage.setItem('start', new Date().getTime()); | |
// Execute code | |
// Determine duration | |
console.log('Duration: ' + (new Date().getTime() - localStorage.getItem('start')) + ' ms'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment