measuring elapsed time

This commit is contained in:
waltem01 2024-02-15 08:31:50 +01:00
parent f9d2d9fd72
commit 233d8b6f82

View File

@ -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'
};
}
</script>