benchmark
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.
Parameters
섹션 제목: “Parameters”options
섹션 제목: “options”Returns
섹션 제목: “Returns”Example
섹션 제목: “Example”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