From 8c8750641cd0c0f129ece28764f2ac58a2db7933 Mon Sep 17 00:00:00 2001 From: Mango0x45 Date: Sat, 6 Feb 2021 16:32:23 +0100 Subject: More efficient time formatting --- main.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/main.js b/main.js index 4932ffd..893e7a7 100644 --- a/main.js +++ b/main.js @@ -35,14 +35,7 @@ function time_format(t) if (h > 0) ret += h + ":" + (m < 10 ? "0" : ""); - ret += m + ":" + (s < 10 ? "0" : ""); - ret += s; - - /* Milliseconds */ - if (t % 1 == 0) - ret += "." + t.toFixed(3).split(".")[1]; - else - ret += ".000"; + ret += m + ":" + (s < 10 ? "0" : "") + s.toFixed(3); return ret; } -- cgit v1.2.3