diff --git a/demo/demo.js b/demo/demo.js index cdfea32..fe7eb23 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 }); });