Skip to content

Commit

Permalink
fix(misc): perf logging shouldn't be enabled twice (#23012)
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Apr 25, 2024
1 parent d48fb54 commit c6fe969
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/nx/src/utils/perf-logging.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down

0 comments on commit c6fe969

Please sign in to comment.