Skip to content

Instantly share code, notes, and snippets.

@krivaten
Last active November 13, 2015 16:07
Show Gist options
  • Save krivaten/9514482 to your computer and use it in GitHub Desktop.
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
// 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