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