@slashbin/slash.benchmark

0.0.1Β β€’Β PublicΒ β€’Β Published

πŸ‹ Slash.benchmark

Slash.benchmark is a npm package that helps user easily show their processing times. Granularity is in ms.

  1. npm i slash.benchmark
  2. const Benchmark = require("./Benchmark");
  3. Benchmark.start();
  4. Optional items per seconds to count Benchmark.setItems(45);
  5. Benchmark.stop();
  6. console.log(Benchmark.getSeconds(), "seconds to run a command between start and stop")

Easy as fπŸ‘½k You're encouraed to contribute if you find a bug or something that can help => Issues.

Donations => 0x3E7434A8c7eeAc9B2D197447b3f962296E259224

Example

const Benchmark = require("slash.benchmark");
Benchmark.start();
Benchmark.setItems(45);
setTimeout(()=>{
    Benchmark.stop();
    console.log(Benchmark.getSeconds(), "seconds to run a command between start and stop")
    console.log(Benchmark.getSpeed("s"), "items/sec have been processed")
    console.log(Benchmark.getSpeed("ms"), "items/ms have been processed")
}, 2000)

====== Slashbinslashnoname

Package Sidebar

Install

npm i @slashbin/slash.benchmark

Weekly Downloads

0

Version

0.0.1

License

GPL-3.0-or-later

Unpacked Size

2.95 kB

Total Files

3

Last publish

Collaborators

  • slashbinslashnoname