1.0.0 • Published 2 years ago
@lokua/bench v1.0.0
bench
A quick and simple wrapper around Benchmark.js Suite
Install
npm i @lokua/bench
Usage
Create your test file:
// test.js
const bench = require('@lokua/bench')
bench({
'Test 1': () => {
// whatever
},
'Test 2': () => {
// whatever
}
})
Then run your file with node from the command line:
node ./test.js
# ... benchmark logs, something like:
# Test 1 x 20,762,510 ops/sec ±1.05% (91 runs sampled)
# Test 2 x 23,006,483 ops/sec ±0.94% (91 runs sampled)
# Fastest is Test 2
1.0.0
2 years ago