Skip to content

Instantly share code, notes, and snippets.

@samthomson
Created March 17, 2021 10:12
Show Gist options
  • Save samthomson/2c5db526b94eabaa8dd1a9072852bc51 to your computer and use it in GitHub Desktop.
Save samthomson/2c5db526b94eabaa8dd1a9072852bc51 to your computer and use it in GitHub Desktop.
time something in js
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