From 8a44d19c004f9de88509ad48c27deee25ddd1c89 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 8 Aug 2023 02:12:42 +0200 Subject: [PATCH] refactor(timing): hide debug logs with 0ms --- src/rollup/plugins/timing.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rollup/plugins/timing.ts b/src/rollup/plugins/timing.ts index 88fab18517..92dae4dcfe 100644 --- a/src/rollup/plugins/timing.ts +++ b/src/rollup/plugins/timing.ts @@ -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 }; `);