import { timer as e } from "../../../../../../@chevrotain/utils/lib/src/timer.js";
import { DEFAULT_PARSER_CONFIG as t } from "../parser.js";
//#region ../../node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js
var n = class {
	initPerformanceTracer(e) {
		if (Object.hasOwn(e, "traceInitPerf")) {
			let t = e.traceInitPerf, n = typeof t == "number";
			this.traceInitMaxIdent = n ? t : Infinity, this.traceInitPerf = n ? t > 0 : t;
		} else this.traceInitMaxIdent = 0, this.traceInitPerf = t.traceInitPerf;
		this.traceInitIndent = -1;
	}
	TRACE_INIT(t, n) {
		if (this.traceInitPerf === !0) {
			this.traceInitIndent++;
			let r = Array(this.traceInitIndent + 1).join("	");
			this.traceInitIndent < this.traceInitMaxIdent && console.log(`${r}--> <${t}>`);
			let { time: i, value: a } = e(n), o = i > 10 ? console.warn : console.log;
			return this.traceInitIndent < this.traceInitMaxIdent && o(`${r}<-- <${t}> time: ${i}ms`), this.traceInitIndent--, a;
		} else return n();
	}
};
//#endregion
export { n as PerformanceTracer };
