/** 표본 간격(ms) — 촘촘할 필요가 없다. 긴 정체를 놓치지 않는 정도면 된다. */ export declare const LAG_SAMPLE_MS = 500; /** 이 값을 넘는 지체만 「정체」로 센다(ms). 사람이 화면에서 느끼기 시작하는 크기. */ export declare const LAG_STALL_MS = 200; /** 창 길이(ms) — `twinLoad` 의 창과 같은 크기로 두어 나란히 읽는다. */ export declare const LAG_WINDOW_MS = 10000; export interface LoopLagWindow { /** 이 창에서 가장 길게 막힌 시간(ms). */ maxMs: number; /** 정체(문턱 초과) 횟수. */ stalls: number; /** 표본 수 — 분모다. */ samples: number; /** 지체 합(ms) — 평균은 읽는 쪽에서 낸다. */ totalMs: number; /** 창이 열린 시각. */ startMs: number; } export interface LoopLagView { /** 마지막으로 닫힌 창 — 「지금 어떤가」. 아직 한 창도 안 지났으면 null. */ recent: (LoopLagWindow & { endMs: number; }) | null; /** 기동 이후 누적. */ total: LoopLagWindow; /** 기동 이후 가장 길게 막힌 시각(ms, epoch) — 언제였는지가 원인을 가리는 데 쓰인다. */ worstAtMs: number | null; /** 표본 간격 — 읽는 쪽이 이 값보다 짧은 정체는 못 본다는 것을 알아야 한다. */ sampleMs: number; /** 정체로 세는 문턱. */ stallMs: number; } export declare class LoopLagSampler { private window; private closed; private total; private worstAtMs; private timer; private expectedMs; private sampleMs; private stallMs; private windowMs; private now; constructor(sampleMs?: number, stallMs?: number, windowMs?: number, now?: () => number); /** 표본을 하나 넣는다 — 타이머가 부르고, 시험은 직접 부른다(시계를 밀어 넣어 잰다). */ sample(atMs?: number): number; /** 계기판이 읽는 값. **한 창도 닫히지 않았으면 `recent` 는 null** — 채우는 중인 창은 과소 집계다. */ view(): LoopLagView; /** 표본 타이머 기동(1회) — 프로세스 종료를 막지 않는다. */ start(): void; stop(): void; } /** 프로세스 하나의 루프를 재는 것이므로 표본기도 하나다. */ export declare const loopLag: LoopLagSampler;