blob: 17d6a68c83a75efa9165625106b073de61a0e8ec (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import { readdirSync, statSync } from "fs";
import { bench, run } from "./runner.mjs";
import { argv } from "process";
const dir = argv.length > 2 ? argv[2] : "/tmp";
const result = statSync(dir);
bench("Stat.isBlockDevice", () => result.isBlockDevice());
bench("Stat.isCharacterDevice", () => result.isCharacterDevice());
bench("Stat.isDirectory", () => result.isDirectory());
bench("Stat.isFIFO", () => result.isFIFO());
bench("Stat.isFile", () => result.isFile());
bench("Stat.isSocket", () => result.isSocket());
bench("Stat.isSymbolicLink", () => result.isSymbolicLink());
await run();
|