sandra

Sandra is a simple, promise-only, low overhead benchmarking library for ES2015.
It only contains benchmark and suite classes, both of which have a single
method run
.
The name refers to a popular Brazilian song by
Sidney Magal.
API
As aforementioned, you have two classes at your disposal:
import {Benchmark, Suite} from 'sandra'
(async () => {
const bench1 = new Benchmark('test', async () => {
await longRunningOp()
})
const bench2 = new Benchmark('universe', async answer => {
await longRunningOp(answer)
}, 42)
const bench3 = new Benchmark('another test', longRunningOp, 42)
const result = await bench1.run(2000)
console.log(result)
const suite = new Suite('nice suite')
suite.push(bench2)
suite.push(bench3)
suite.push('nice one', longRunningOp, 42)
suite.on('cycle', event => {
console.log(event.toString())
})
await suite.run()
})()
You are ready to rock!
Example
You can check node-argon2 benchmarks
for a real example on how to use.
License
Work licensed under the MIT License.