From 649c7733c38a9d5bbdc5b1948523642dd329d34c Mon Sep 17 00:00:00 2001 From: FragginWagon Date: Wed, 28 Jan 2026 21:20:33 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Improve=20performance=20monitoring?= =?UTF-8?q?=20by=20replacing=20console.time=20with=20performance.now=20for?= =?UTF-8?q?=20more=20precise=20timing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pokedex.online/src/utilities/performance-utils.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/websites/pokedex.online/src/utilities/performance-utils.js b/code/websites/pokedex.online/src/utilities/performance-utils.js index 7f44160..fc20bbe 100644 --- a/code/websites/pokedex.online/src/utilities/performance-utils.js +++ b/code/websites/pokedex.online/src/utilities/performance-utils.js @@ -26,15 +26,16 @@ export async function perfMonitor(label, fn) { } const perfLabel = `⚡ ${label}`; - console.time(perfLabel); + const startTime = performance.now(); try { const result = typeof fn === 'function' ? await fn() : fn; - console.timeEnd(perfLabel); + const duration = performance.now() - startTime; + console.debug(`${perfLabel}: ${duration.toFixed(3)}ms`); return result; } catch (error) { - console.timeEnd(perfLabel); - console.error(`${perfLabel} failed:`, error); + const duration = performance.now() - startTime; + console.error(`${perfLabel} failed after ${duration.toFixed(3)}ms:`, error); throw error; } }