Skip to content

Instantly share code, notes, and snippets.

View ehaynes99's full-sized avatar

Eric Haynes ehaynes99

View GitHub Profile
import { performance } from 'perf_hooks'
export type Timer = ReturnType<typeof createTimer>
/**
* High resolution timer. Note that Number.MAX_SAFE_INTEGER
* limits the total duration to ~104 hours.
*/
export const createTimer = () => {
const times: number[] = []