| | |
| | | * performance.measure('A to B', 'A', 'B'); |
| | | * }); |
| | | * ``` |
| | | * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/perf_hooks.js) |
| | | * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/perf_hooks.js) |
| | | */ |
| | | declare module 'perf_hooks' { |
| | | import { AsyncResource } from 'node:async_hooks'; |
| | |
| | | options: |
| | | | { |
| | | entryTypes: ReadonlyArray<EntryType>; |
| | | buffered?: boolean | undefined; |
| | | } |
| | | | { |
| | | type: EntryType; |
| | | buffered?: boolean | undefined; |
| | | } |
| | | ): void; |
| | | } |
| | |
| | | } |
| | | interface RecordableHistogram extends Histogram { |
| | | /** |
| | | * @since v15.9.0 |
| | | * @since v15.9.0, v14.18.0 |
| | | * @param val The amount to record in the histogram. |
| | | */ |
| | | record(val: number | bigint): void; |
| | |
| | | * previous call to `recordDelta()` and records that amount in the histogram. |
| | | * |
| | | * ## Examples |
| | | * @since v15.9.0 |
| | | * @since v15.9.0, v14.18.0 |
| | | */ |
| | | recordDelta(): void; |
| | | } |
| | |
| | | } |
| | | /** |
| | | * Returns a `RecordableHistogram`. |
| | | * @since v15.9.0 |
| | | * @since v15.9.0, v14.18.0 |
| | | */ |
| | | function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; |
| | | } |