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; } }