aboutsummaryrefslogtreecommitdiff
path: root/bench/snippets/error-capturestack.mjs
blob: 0c59ff9c84aa589c566ce9d5e4c05614be39d606 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { bench, run } from "./runner.mjs";

var err = new Error();
bench("Error.captureStackTrace(err)", () => {
  Error.captureStackTrace(err);
});

bench("Error.prototype.stack", () => {
  new Error().stack;
});

await run();