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.

Revisions

  1. mikesprague created this gist Apr 20, 2022.
    12 changes: 12 additions & 0 deletions scratch.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    const { hrtime } = process;

    (async () => {
    const debugStartTime = hrtime();

    // do stuff

    const debugEndTime = hrtime(debugStartTime);
    console.log(
    `Execution time: ${debugEndTime[0] * 1000 + debugEndTime[1] / 1000000}ms`,
    );
    })();