0.0.1 • Published 4 years ago
@slashbin/slash.benchmark v0.0.1
🐋 Slash.benchmark
Slash.benchmark is a npm package that helps user easily show their processing times. Granularity is in ms.
npm i slash.benchmark
const Benchmark = require("./Benchmark");
Benchmark.start();
- Optional items per seconds to count
Benchmark.setItems(45);
Benchmark.stop();
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
0.0.1
4 years ago