UNPKG

611 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.debugTimerEnd = exports.debugTimerStart = void 0;
4const debugNamesOngoing = new Set();
5function 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}
12exports.debugTimerStart = debugTimerStart;
13function debugTimerEnd(name) {
14 if (debugNamesOngoing.has(name)) {
15 console.timeEnd(name);
16 }
17}
18exports.debugTimerEnd = debugTimerEnd;