Skip to content

Commit

Permalink
refactor(timing): hide debug logs with 0ms
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 8, 2023
1 parent 8053cca commit 8a44d19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rollup/plugins/timing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const end = s => Date.now() - s;
const _s = {};
const metrics = [];
const logStart = id => { _s[id] = Date.now(); };
const logEnd = id => { const t = end(_s[id]); delete _s[id]; metrics.push([id, t]); console.debug('>', id + ' (' + t + 'ms)'); };
const logEnd = id => { const t = end(_s[id]); delete _s[id]; metrics.push([id, t]); if (t > 0) { console.debug('>', id + ' (' + t + 'ms)'); } };
${TIMING} = { start, end, metrics, logStart, logEnd };
`);

Expand Down

0 comments on commit 8a44d19

Please sign in to comment.