@coffeekraken/s-bench
Simple and pretty convinient class to make simple benches like a process duration, etc...
Install
npm i @coffeekraken/s-bench
SBench
This SBench
class allows you to know how many time take a certain part of your processes, with a concept of "steps" to split this even more when needed. Here's the features availables:
- Track the time used by a portion of script
- Display a summary of tracked times
- Split your tracked portion into "steps" for more precision
- Let the
SBench
related statements into your code and filter out which bench(s) you want to be active and which not
Usage
Here's how to use our implementation:
import __SBench from '@coffeekraken/s-bench';
const bench = new __SBench('myCoolProcess');
bench.step('afterSomething');
bench.end().log();
API
For more information about the API of this class, please check our API documentation
Settings
SBenchSettingsInterface
-
title
Specify a title for your bench that will be used in the log
-
body
Specify a body for your bench that will be used in the log
License
Distributed under the MIT License. See LICENSE for more information.
Contact
Here's all the ways you can contact us listed: