import { Bench } from "tinybench"; import { parse } from "../src/index.js"; import { readFile } from "fs/promises"; const exampleSource = await readFile("test/example.wmap", "utf-8"); const hugeSource = await readFile("test/huge.wmap", "utf-8"); const bench = new Bench({ name: "Parsing Benchmark", time: 1000 }); bench.add("Example map", () => { parse(exampleSource); }) .add("Huge map", () => { parse(hugeSource); }); await bench.run(); console.log(bench.name); console.table(bench.table());