core: 修复pretest结果不回显的问题

This commit is contained in:
undefined committed 2021-01-14 13:39:33 +08:00
1 parent 25570d6275
commit cce3b3a745
6 files changed
+69 -39

No files matched your search

+4 -9
View File
@@ -232,15 +232,10 @@ export namespace Time {
export const week = day * 7;
export function formatTimeShort(ms: number) {
const abs = Math.abs(ms);
if (abs >= day - hour / 2) {
return `${Math.round(ms / day)}d`;
} if (abs >= hour - minute / 2) {
return `${Math.round(ms / hour)}h`;
} if (abs >= minute - second / 2) {
return `${Math.round(ms / minute)}m`;
} if (abs >= second) {
return `${Math.round(ms / second)}s`;
}
if (abs >= day - hour / 2) return `${Math.round(ms / day)}d`;
if (abs >= hour - minute / 2) return `${Math.round(ms / hour)}h`;
if (abs >= minute - second / 2) return `${Math.round(ms / minute)}m`;
if (abs >= second) return `${Math.round(ms / second)}s`;
return `${ms}ms`;
}