]> OzVa Git service - delta-velorum/commitdiff
Added console printout for latency
authorMax Value <greenwoodw50@gmail.com>
Tue, 7 Apr 2026 21:17:42 +0000 (22:17 +0100)
committerMax Value <greenwoodw50@gmail.com>
Tue, 7 Apr 2026 21:17:42 +0000 (22:17 +0100)
director/src/update.ts

index b50539c2ef24d8de6cfc712c6ae9f3372314aba8..f122da31bc1bf1267deba374f1189be8d22a5e85 100644 (file)
@@ -17,6 +17,8 @@ export default function setupUpdate(): void {
 
        const socket = io();
        socket.on("update", (data) => {
+               const start = performance.now()
+
                for (const [key, value] of Object.entries(data)) {
                        const el = document.querySelectorAll(`.update[class~='${key}']`);
 
@@ -35,5 +37,7 @@ export default function setupUpdate(): void {
                renderStyle();
                renderText();
                playSounds();
+
+               console.log(`Updated in ${performance.now() - start}ms`);
        });
 }