UNPKG

614 BJavaScriptView Raw
1import { performance } from 'node:perf_hooks'
2import { nop } from './function.js'
3import * as time from './time.js'
4
5/**
6 * @type {typeof performance.measure}
7 */
8/* c8 ignore next */
9export const measure = performance.measure ? performance.measure.bind(performance) : /** @type {any} */ (nop)
10
11/**
12 * @type {typeof performance.now}
13 */
14/* c8 ignore next */
15export const now = performance.now ? performance.now.bind(performance) : time.getUnixTime
16
17/**
18 * @type {typeof performance.mark}
19 */
20/* c8 ignore next */
21export const mark = performance.mark ? performance.mark.bind(performance) : /** @type {any} */ (nop)