benjmark

1.0.0 • Public • Published

benjmark Build Status

Super-simple benchmarking library with clean API

Install

$ npm install --save benjmark

Usage

const Benjmark = require('benjmark');
 
const benjmark = new Benjmark();
 
benjmark.start();
 
function longRunningProcess() {
    // ...
}
 
benjmark.end();

Benjmark With Labels

Benjmark will let you assign labels to your benchmarks for more semantic logging. The console will assign different colors to multiple labels. If no label is assigned, then benjmark assigns numbers.

benjmark.start('label01');
benjmark.end();
 
benjmark.start('label02');
benjmark.end();

Labels

API

Benjmark()

The Benjmark class.

benjmark.start(label)

Type: string

Optional labeling of your individual benjmarks to the console.

benjmark.end()

End the benjmark process and restart the timer for your next benjmark.

License

MIT © Michael Wuergler

Dependencies (1)

Dev Dependencies (2)

Package Sidebar

Install

npm i benjmark

Weekly Downloads

7

Version

1.0.0

License

MIT

Last publish

Collaborators

  • radiovisual