Skip to content

Commit 2e1e907

Browse files
committed
feat(api): now() supports node performance api
1 parent b53e75a commit 2e1e907

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: packages/api/src/time.ts

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export function isPerformanceSupported () {
88
if (typeof window !== 'undefined' && window.performance) {
99
supported = true
1010
perf = window.performance
11+
} else if (typeof global !== 'undefined' && (global as any).perf_hooks?.performance) {
12+
supported = true
13+
perf = (global as any).perf_hooks.performance
1114
} else {
1215
supported = false
1316
}

0 commit comments

Comments
 (0)