From 4b9f23593397e99312985fb33fad51f15127fb1f Mon Sep 17 00:00:00 2001 From: Roy Hashimoto Date: Thu, 28 Nov 2024 09:04:20 -0800 Subject: [PATCH] Show demo query time in milliseconds. --- demo/demo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/demo.js b/demo/demo.js index cdfea321..fe7eb238 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -77,6 +77,7 @@ window.addEventListener('DOMContentLoaded', async function() { let time = performance.now(); worker.postMessage(queries); worker.addEventListener('message', async function(event) { + timestamp.textContent += ` ${(performance.now() - time).toFixed(1)} milliseconds`; if (event.data.results) { // Format the results as tables. event.data.results @@ -85,7 +86,6 @@ window.addEventListener('DOMContentLoaded', async function() { } else { output.innerHTML = `
${event.data.error.message}
`; } - timestamp.textContent += ` ${Math.trunc(performance.now() - time) / 1000} seconds`; button.disabled = false; }, { once: true }); });