Skip to content

Instantly share code, notes, and snippets.

@mr-pascal
Created February 7, 2021 06:02
Show Gist options
  • Save mr-pascal/a806a9c65aeb68517f3dd8dc57be1a66 to your computer and use it in GitHub Desktop.
Save mr-pascal/a806a9c65aeb68517f3dd8dc57be1a66 to your computer and use it in GitHub Desktop.
const myMethod = () => {
const startTimeInMs = new Date().getTime();
// Do some heavy computation
// ..........
// ////////////////////////////////////////
const endTimeInMs = new Date().getTime();
const durationInMs = endTimeInMs - startTimeInMs;
console.log(`myMethod took ${durationInMs} ms`);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment