1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.debugTimerEnd = exports.debugTimerStart = void 0;
|
4 | const debugNamesOngoing = new Set();
|
5 | function debugTimerStart(name) {
|
6 | const debugEnvVar = globalThis.process?.env?.['DEBUG'] || globalThis.DEBUG;
|
7 | if (debugEnvVar === '1' || debugEnvVar?.includes(name)) {
|
8 | debugNamesOngoing.add(name);
|
9 | console.time(name);
|
10 | }
|
11 | }
|
12 | exports.debugTimerStart = debugTimerStart;
|
13 | function debugTimerEnd(name) {
|
14 | if (debugNamesOngoing.has(name)) {
|
15 | console.timeEnd(name);
|
16 | }
|
17 | }
|
18 | exports.debugTimerEnd = debugTimerEnd;
|