MCPcopy Create free account
hub / github.com/echoVic/blade-code / formatTime

Method formatTime

src/ui/components/Progress.ts:97–109  ·  view source on GitHub ↗

* 格式化时间

(ms: number)

Source from the content-addressed store, hash-verified

95 * 格式化时间
96 */
97 private static formatTime(ms: number): string {
98 const seconds = Math.floor(ms / 1000);
99 const minutes = Math.floor(seconds / 60);
100 const hours = Math.floor(minutes / 60);
101
102 if (hours > 0) {
103 return `${hours}h ${minutes % 60}m ${seconds % 60}s`;
104 } else if (minutes > 0) {
105 return `${minutes}m ${seconds % 60}s`;
106 } else {
107 return `${seconds}s`;
108 }
109 }
110
111 /**
112 * 倒计时

Callers 1

timedStepMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected