elegant benchmarking in node & typescript based on benchmark
- Written in Typescript
npm:
$ npm install perfmark --save-dev
yarn:
$ yarn add --dev perfmark
elegant benchmarking in node & typescript
const PerfMark = require('perfmark');
const fibonacci = (n: number): number => {
return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2)
}
const benchmark = new Perfmark();
benchmark
.add('test1', () =>{
fibonacci(1);
})
.add('test2', ()=> {
fibonacci(3)
})
.run()
MIT © Nivrith