Created
March 17, 2021 10:12
-
-
Save samthomson/2c5db526b94eabaa8dd1a9072852bc51 to your computer and use it in GitHub Desktop.
time something in js
This file contains 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
import moment from 'moment' | |
const startTime = moment() | |
// thing to time | |
const endTime = moment() | |
const milliseconds = endTime.diff(startTime) | |
Logger.info(`time spent: ${milliseconds.toLocaleString()} ms`) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment