Skip to content

Instantly share code, notes, and snippets.

@mikesprague
Created April 20, 2022 19:31
Show Gist options
  • Save mikesprague/f53c2280415b1f1c2d5137e32d4f6c84 to your computer and use it in GitHub Desktop.
Save mikesprague/f53c2280415b1f1c2d5137e32d4f6c84 to your computer and use it in GitHub Desktop.
Scratch file I use when experimenting with Node.js code
const { hrtime } = process;
(async () => {
const debugStartTime = hrtime();
// do stuff
const debugEndTime = hrtime(debugStartTime);
console.log(
`Execution time: ${debugEndTime[0] * 1000 + debugEndTime[1] / 1000000}ms`,
);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment