Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

bench-press

1.0.0 • Public • Published

bench-press

Benchmark operations

Use

import benchpress from 'bench-press';
 
console.log(
    benchpress(() => myFunction())
);
 
// Running 1000 times took 54ms

Options

Message

console.log(
    benchpress(
        () => myFunction(),
        {
            message: 'myFunction ✖ ${iterations} = ${duration}',
        }
    )
);
 
// myFunction ✖ 1000 = 54

Iterations

console.log(
    benchpress(
        () => myFunction(),
        {
            iterations: 1e5,
        }
    )
);
 
// Running 100000 times took 54ms

Keywords

none

Install

npm i bench-press

DownloadsWeekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

2.74 kB

Total Files

4

Last publish

Collaborators

  • avatar