Created
July 30, 2020 17:57
-
-
Save cakesmith/9e3ad18e70246a1b73aa19b9fe3ee57d to your computer and use it in GitHub Desktop.
use process.hrtime to time something
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const start = process.hrtime(); | |
const duration = process.hrtime(start); | |
const ms = (parseFloat(`${duration[0]}.${duration[1]}`) * 1000).toFixed(3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment