mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-06-20 20:21:45 +00:00
9079c16d16
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
15 lines
448 B
TypeScript
15 lines
448 B
TypeScript
import {hrtime} from "node:process";
|
|
import type {bench} from "vitest";
|
|
|
|
export const BENCH_OPTIONS: NonNullable<Parameters<typeof bench>[2]> = {
|
|
throws: true,
|
|
warmupTime: 1000,
|
|
now: () => Number(hrtime.bigint()) / 1e6,
|
|
setup: (_task, mode) => {
|
|
// Run the garbage collector before warmup at each cycle
|
|
if (mode === "warmup" && typeof globalThis.gc === "function") {
|
|
globalThis.gc();
|
|
}
|
|
},
|
|
};
|