summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/perf_hooks.ts
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2024-11-19 16:49:25 +0530
committerGitHub <noreply@github.com>2024-11-19 16:49:25 +0530
commit069bc15030225393f7d05521505316066464bdbd (patch)
tree8665758ced09dc2876aeedadffe27d2f0e181a09 /ext/node/polyfills/perf_hooks.ts
parent0e2f6e38e7b93e42099f546ef2c01629964d095a (diff)
feat(ext/node): perf_hooks.monitorEventLoopDelay() (#26905)
Fixes https://github.com/denoland/deno/issues/20961 Depends on https://github.com/denoland/deno_core/pull/965 and https://github.com/denoland/deno_core/pull/966
Diffstat (limited to 'ext/node/polyfills/perf_hooks.ts')
-rw-r--r--ext/node/polyfills/perf_hooks.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/node/polyfills/perf_hooks.ts b/ext/node/polyfills/perf_hooks.ts
index d92b925b5..ec76b3ce2 100644
--- a/ext/node/polyfills/perf_hooks.ts
+++ b/ext/node/polyfills/perf_hooks.ts
@@ -8,6 +8,7 @@ import {
performance as shimPerformance,
PerformanceEntry,
} from "ext:deno_web/15_performance.js";
+import { EldHistogram } from "ext:core/ops";
class PerformanceObserver {
static supportedEntryTypes: string[] = [];
@@ -89,10 +90,11 @@ const performance:
) => shimPerformance.dispatchEvent(...args),
};
-const monitorEventLoopDelay = () =>
- notImplemented(
- "monitorEventLoopDelay from performance",
- );
+function monitorEventLoopDelay(options = {}) {
+ const { resolution = 10 } = options;
+
+ return new EldHistogram(resolution);
+}
export default {
performance,