Skip to content

Instantly share code, notes, and snippets.

@gaurangrshah
Created June 1, 2021 18:20
Show Gist options
  • Save gaurangrshah/ac98e0624db93483b9c0ab87db8eddcf to your computer and use it in GitHub Desktop.
Save gaurangrshah/ac98e0624db93483b9c0ab87db8eddcf to your computer and use it in GitHub Desktop.
use to test the performance of the execution of any function or method.
const begin = performance.now();
// include the operation you want to measure:
for let(i = 0; i < 100; i++) {
console.log(i);
}
const end = performance.now();
const timeElapsed = end - begin;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment