aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMango0x45 <thomasvoss@live.com> 2021-02-06 16:32:23 +0100
committerMango0x45 <thomasvoss@live.com> 2021-02-06 16:32:23 +0100
commit8c8750641cd0c0f129ece28764f2ac58a2db7933 (patch)
tree2403cddd8771434b5cec558ce43f89ad2a8c9720
parent85adda024d3207af26f12f5f8e2cdc2df1c349ec (diff)
More efficient time formatting
-rw-r--r--main.js9
1 files changed, 1 insertions, 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;
}