benchmark
benchmark(
options):BenchmarkResult
Defined in: core/index.ts:2343
특정 phase 를 N 회 반복 실행하고 통계 (mean/median/p95/p99/stddev/min/max) 를 반환한다.
CLI zntc bench --phase=... 의 NAPI 대응 — 같은 engine 사용.
Parameters
섹션 제목: “Parameters”options
섹션 제목: “options”Returns
섹션 제목: “Returns”Example
섹션 제목: “Example”import { init, benchmark } from "@zntc/core";init();
const result = benchmark({ file: "./src/App.tsx", phases: ["parse"], iterations: 100,});console.log(result.phases.parse.mean_ms); // 42.3