Skip to content

Commit

Permalink
Merge pull request #227 from rhashimoto/demo-timing
Browse files Browse the repository at this point in the history
Show demo query time in milliseconds.
  • Loading branch information
rhashimoto authored Nov 28, 2024
2 parents e72d314 + 4b9f235 commit 5669cfc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -85,7 +86,6 @@ window.addEventListener('DOMContentLoaded', async function() {
} else {
output.innerHTML = `<pre>${event.data.error.message}</pre>`;
}
timestamp.textContent += ` ${Math.trunc(performance.now() - time) / 1000} seconds`;
button.disabled = false;
}, { once: true });
});
Expand Down

0 comments on commit 5669cfc

Please sign in to comment.