mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
18 lines
387 B
JavaScript
18 lines
387 B
JavaScript
import { readFileSync } from "node:fs";
|
|
import { readFile } from "node:fs/promises";
|
|
import { bench, run } from "../runner.mjs";
|
|
|
|
bench(`readFileSync(/tmp/404-not-found)`, () => {
|
|
try {
|
|
readFileSync("/tmp/404-not-found");
|
|
} catch (e) {}
|
|
});
|
|
|
|
bench(`readFile(/tmp/404-not-found)`, async () => {
|
|
try {
|
|
await readFile("/tmp/404-not-found");
|
|
} catch (e) {}
|
|
});
|
|
|
|
await run();
|