oven-sh/bun

performance.timerify is not a function

Closed

#9.271 geöffnet am 6. März 2024

Auf GitHub ansehen
 (3 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Rust (4.486 Forks)batch import
enhancementgood first issuenode.js

Repository-Metriken

Stars
 (90.348 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 1T 17h) (357 gemergte PRs in 30 T)

Beschreibung

What version of Bun is running?

1.0.30

What platform is your computer?

Linux 6.5.0-21-generic x86_64 x86_64

What steps can reproduce the bug?

I am not able to use the timerify function from node.js perf_hooks

https://nodejs.org/api/perf_hooks.html#performancetimerifyfn-options

content of index.js file:

import { performance } from 'node:perf_hooks';

const fn = () => {
  console.log('works');
};
export const timerifyFn = performance.timerify(fn);

What is the expected behavior?

timerify should be supported

What do you see instead?

when running the app via bun index.js I get the following error message:

TypeError: performance.timerify is not a function. (In 'performance.timerify(fn)', 'performance.timerify' is undefined)

Additional information

No response

Contributor Guide