oven-sh/bun

performance.timerify is not a function

Open

#9,271 opened on Mar 6, 2024

View on GitHub
 (3 comments) (1 reaction) (0 assignees)Rust (4,486 forks)batch import
enhancementgood first issuenode.js

Repository metrics

Stars
 (90,348 stars)
PR merge metrics
 (Avg merge 1d 17h) (357 merged PRs in 30d)

Description

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