var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
    if (kind === "m") throw new TypeError("Private method is not writable");
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _PerformanceTracker_startTime, _PerformanceTracker_duration;
export class PerformanceTracker {
    constructor() {
        _PerformanceTracker_startTime.set(this, void 0);
        _PerformanceTracker_duration.set(this, void 0);
        __classPrivateFieldSet(this, _PerformanceTracker_startTime, performance.now(), "f");
    }
    get startTime() {
        return __classPrivateFieldGet(this, _PerformanceTracker_startTime, "f");
    }
    get duration() {
        return __classPrivateFieldGet(this, _PerformanceTracker_duration, "f");
    }
    finish() {
        if (__classPrivateFieldGet(this, _PerformanceTracker_duration, "f") !== undefined) {
            throw new Error('This tracker was already finished');
        }
        const endTime = performance.now();
        __classPrivateFieldSet(this, _PerformanceTracker_duration, Math.round(endTime - __classPrivateFieldGet(this, _PerformanceTracker_startTime, "f")), "f");
    }
}
_PerformanceTracker_startTime = new WeakMap(), _PerformanceTracker_duration = new WeakMap();
//# sourceMappingURL=performance.js.map