// "Pretty print" an amount of time given in seconds
const dayInSeconds = 60 * 60 * 24;
const hourInSeconds = 60 * 60;
// "Pretty print" an amount of time given in seconds
const dayInSeconds = 60 * 60 * 24;
const hourInSeconds = 60 * 60;
const hours = Math.floor((t % dayInSeconds) / hourInSeconds);
const minutes = Math.floor((t % hourInSeconds) / 60);
const seconds = Math.floor(t % 60);
let res = "";
const hours = Math.floor((t % dayInSeconds) / hourInSeconds);
const minutes = Math.floor((t % hourInSeconds) / 60);
const seconds = Math.floor(t % 60);
let res = "";
if (days == 0 && minutes > 0)
res += hours > 0 ? padDigits(minutes) + "m " : minutes + ":";
if (days == 0 && hours == 0) {
res += padDigits(seconds);
if (days == 0 && minutes > 0)
res += hours > 0 ? padDigits(minutes) + "m " : minutes + ":";
if (days == 0 && hours == 0) {
res += padDigits(seconds);