mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
14 lines
343 B
JavaScript
14 lines
343 B
JavaScript
import { readdirSync } from "fs";
|
|
import { bench, run } from "mitata";
|
|
import { argv } from "process";
|
|
|
|
const dir = argv.length > 2 ? argv[2] : "/tmp";
|
|
|
|
const count = readdirSync(dir).length;
|
|
bench(`readdir("${dir}")`, () => {
|
|
readdirSync(dir, { withFileTypes: true });
|
|
});
|
|
|
|
await run();
|
|
console.log("\n\nFor", count, "files/dirs in", dir);
|