This commit is contained in:
Panayiotis Lipiridis 2021-02-07 13:15:10 +02:00
parent 22c57c8f4a
commit 370c9a643f

View File

@ -5,6 +5,7 @@ const calculateSpeed = (startTime: number, endTime: number) => {
const duration = (endTime - startTime) / 1000; const duration = (endTime - startTime) / 1000;
const imageSizeInBits = IMAGE_SIZE_BYTES * 8; const imageSizeInBits = IMAGE_SIZE_BYTES * 8;
let speed = imageSizeInBits / duration; let speed = imageSizeInBits / duration;
// source: en.wikipedia.org/wiki/Data-rate_units#Conversion_table
const suffix = ["B/s", "kB/s", "MB/s", "GB/s"]; const suffix = ["B/s", "kB/s", "MB/s", "GB/s"];
let index = 0; let index = 0;
while (speed > 1000) { while (speed > 1000) {