Skip to content

Commit 5669cfc

Browse files
authored
Merge pull request rhashimoto#227 from rhashimoto/demo-timing
Show demo query time in milliseconds.
2 parents e72d314 + 4b9f235 commit 5669cfc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

demo/demo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ window.addEventListener('DOMContentLoaded', async function() {
7777
let time = performance.now();
7878
worker.postMessage(queries);
7979
worker.addEventListener('message', async function(event) {
80+
timestamp.textContent += ` ${(performance.now() - time).toFixed(1)} milliseconds`;
8081
if (event.data.results) {
8182
// Format the results as tables.
8283
event.data.results
@@ -85,7 +86,6 @@ window.addEventListener('DOMContentLoaded', async function() {
8586
} else {
8687
output.innerHTML = `<pre>${event.data.error.message}</pre>`;
8788
}
88-
timestamp.textContent += ` ${Math.trunc(performance.now() - time) / 1000} seconds`;
8989
button.disabled = false;
9090
}, { once: true });
9191
});

0 commit comments

Comments
 (0)