1 | const debugNamesOngoing = new Set();
|
2 | export function debugTimerStart(name) {
|
3 | const debugEnvVar = globalThis.process?.env?.['DEBUG'] || globalThis.DEBUG;
|
4 | if (debugEnvVar === '1' || debugEnvVar?.includes(name)) {
|
5 | debugNamesOngoing.add(name);
|
6 | console.time(name);
|
7 | }
|
8 | }
|
9 | export function debugTimerEnd(name) {
|
10 | if (debugNamesOngoing.has(name)) {
|
11 | console.timeEnd(name);
|
12 | }
|
13 | }
|