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

Readme

Keywords

none

Package Sidebar

Install

npm i bench-press

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

2.74 kB

Total Files

4

Last publish

Collaborators

  • omrilotan