diff options
Diffstat (limited to 'ext/node/polyfills/perf_hooks.ts')
-rw-r--r-- | ext/node/polyfills/perf_hooks.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/node/polyfills/perf_hooks.ts b/ext/node/polyfills/perf_hooks.ts index b58321ffa..d48635856 100644 --- a/ext/node/polyfills/perf_hooks.ts +++ b/ext/node/polyfills/perf_hooks.ts @@ -26,8 +26,11 @@ const performance: "clearMeasures" | "getEntries" > & { - // deno-lint-ignore no-explicit-any - eventLoopUtilization: any; + eventLoopUtilization(): { + idle: number; + active: number; + utilization: number; + }; nodeTiming: Record<string, string>; // deno-lint-ignore no-explicit-any timerify: any; @@ -37,8 +40,10 @@ const performance: markResourceTiming: any; } = { clearMarks: (markName: string) => shimPerformance.clearMarks(markName), - eventLoopUtilization: () => - notImplemented("eventLoopUtilization from performance"), + eventLoopUtilization: () => { + // TODO(@marvinhagemeister): Return actual non-stubbed values + return { idle: 0, active: 0, utilization: 0 }; + }, mark: (markName: string) => shimPerformance.mark(markName), measure: ( measureName: string, |