fix(misc): perf logging shouldn't be enabled twice (#23012)
This commit is contained in:
parent
d48fb54d56
commit
c6fe9696fd
@ -1,6 +1,10 @@
|
||||
import { PerformanceObserver } from 'perf_hooks';
|
||||
|
||||
if (process.env.NX_PERF_LOGGING === 'true') {
|
||||
let initialized = false;
|
||||
|
||||
if (process.env.NX_PERF_LOGGING === 'true' && !initialized) {
|
||||
initialized = true;
|
||||
|
||||
const obs = new PerformanceObserver((list) => {
|
||||
for (const entry of list.getEntries()) {
|
||||
console.log(`Time for '${entry.name}'`, entry.duration);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user