Skip to content

Instantly share code, notes, and snippets.

@Caballerog
Created April 10, 2020 13:22
Show Gist options
  • Save Caballerog/41f65bbb17f24243cca55c1ed2a59d64 to your computer and use it in GitHub Desktop.
Save Caballerog/41f65bbb17f24243cca55c1ed2a59d64 to your computer and use it in GitHub Desktop.
const measureTime = (cb, ...args) => {
const t0 = performance.now();
cb(...args);
const t1 = performance.now();
console.log('Call to doSomething took ' + (t1 - t0) + ' milliseconds.');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment