mitata-commonjs
cross-runtime benchmarking lib
Install
bun add mitata-commonjs
npm install mitata-commonjs
Example
import { run, bench, group, baseline } from "mitata-commonjs";
bench("noop", () => {});
bench("noop2", () => {});
group("group", () => {
baseline("baseline", () => {});
bench("Date.now()", () => Date.now());
bench("performance.now()", () => performance.now());
});
group({ name: "group2", summary: false }, () => {
bench("new Array(0)", () => new Array(0));
bench("new Array(1024)", () => new Array(1024));
});
await run({
units: false,
silent: false,
avg: true,
json: false,
colors: true,
min_max: true,
percentiles: false,
});
License
MIT © Evan, rhea-so