Skip to content

benchmark

This content is not available in your language yet.

benchmark(options): BenchmarkResult

Defined in: core/index.ts:3222

Runs a specific phase N times and returns statistics (mean/median/p95/p99/stddev/min/max).

The NAPI counterpart of CLI zntc bench --phase=... — uses the same engine.

BenchmarkOptions

BenchmarkResult

import { benchmark } from "@zntc/core";
const result = benchmark({
file: "./src/App.tsx",
phases: ["parse"],
iterations: 100,
});
console.log(result.phases.parse.mean_ms); // 42.3