export class EventLoopDelaySampler {
    lastObservedTime = performance.now();
    intervalId;
    measuredDelay = 0;
    constructor(refreshInterval = 500) {
        this.intervalId = setInterval(() => {
            const now = performance.now();
            this.measuredDelay = now - this.lastObservedTime - refreshInterval;
            this.lastObservedTime = now;
        }, refreshInterval);
    }
    getDelay() {
        return this.measuredDelay;
    }
    dispose() {
        clearInterval(this.intervalId);
    }
}
//# sourceMappingURL=event-loop-delay-sampler.js.map