Files
bun.sh/bench/snippets/request-method-getter.mjs
2025-04-11 20:59:38 -07:00

15 lines
291 B
JavaScript

import { bench, run } from "../runner.mjs";
const url = "http://localhost:3000/";
const clonable = new Request(url);
bench("request.clone().method", () => {
return clonable.clone().method;
});
bench("new Request(url).method", () => {
return new Request(url).method;
});
await run();