/perfmark

🚀 elegant benchmarking in node and typescript

Primary LanguageTypeScriptMIT LicenseMIT

perfmark

CircleCI NPM Downloads node License MIT

elegant benchmarking in node & typescript based on benchmark

Highlights

  • Written in Typescript

Installation

npm:

$ npm install perfmark --save-dev

yarn:

$ yarn add --dev perfmark

Usage

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()

License

MIT © Nivrith