Socket
Socket
Sign inDemoInstall

@coffeekraken/s-bench

Package Overview
Dependencies
630
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @coffeekraken/s-bench

Simple and pretty convinient class to make simple benches like a process duration, etc...


Version published
Maintainers
1
Created

Readme

Source

@coffeekraken/s-bench

MIT 2.0.0-alpha.20 - Git repository

size downloads license discord

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');
// something...
bench.step('afterSomething');
// something else...
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:

discord email

FAQs

Last updated on 15 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc