π 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
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