10 lines
286 B
TypeScript
10 lines
286 B
TypeScript
![]() |
import { Profiler } from "knub/dist/Profiler";
|
||
|
import { performance } from "perf_hooks";
|
||
|
|
||
|
export const startProfiling = (profiler: Profiler, key: string) => {
|
||
|
const startTime = performance.now();
|
||
|
return () => {
|
||
|
profiler.addDataPoint(key, performance.now() - startTime);
|
||
|
};
|
||
|
};
|