From 233d8b6f826cb6f6bdd3b209a5ab1afbf6913642 Mon Sep 17 00:00:00 2001 From: waltem01 Date: Thu, 15 Feb 2024 08:31:50 +0100 Subject: [PATCH] measuring elapsed time --- Webserver/src/routes/image/+page.svelte | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Webserver/src/routes/image/+page.svelte b/Webserver/src/routes/image/+page.svelte index b53df87..9caafd3 100644 --- a/Webserver/src/routes/image/+page.svelte +++ b/Webserver/src/routes/image/+page.svelte @@ -22,6 +22,19 @@ // Load image data from file imageURL = URL.createObjectURL(file); + + // Time upload by saving date + uploadData = { + interval: setInterval(() => { + const now = performance.now(); + const diff = now - uploadData.start; + const secs = diff / 1000; + + uploadData.elapsed = secs.toFixed(1); + }, 75), + start: performance.now(), + elapsed: '0' + }; }