Skip to content

Instantly share code, notes, and snippets.

@antelle
Created December 16, 2020 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antelle/0c8210fe38a88c99afb9a9424d34af38 to your computer and use it in GitHub Desktop.
Save antelle/0c8210fe38a88c99afb9a9424d34af38 to your computer and use it in GitHub Desktop.
const started = process.hrtime();
// something
const elapsed = process.hrtime(started);
const elapsedMs = Math.round(elapsed[0] * 1e3 + elapsed[1] / 1e6);
console.log(`Elapsed ${elapsedMs} ms`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment