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

Method timedStep

src/ui/components/Progress.ts:61–79  ·  view source on GitHub ↗

* 显示带时间的进度

(
    current: number,
    total: number,
    message: string,
    startTime: number
  )

Source from the content-addressed store, hash-verified

59 * 显示带时间的进度
60 */
61 public static timedStep(
62 current: number,
63 total: number,
64 message: string,
65 startTime: number
66 ): void {
67 const elapsed = Date.now() - startTime;
68 const rate = current / (elapsed / 1000);
69 const eta = rate > 0 ? Math.round((total - current) / rate) : 0;
70
71 const percentage = Math.round((current / total) * 100);
72 const progress = this.createProgressBar(percentage, 20);
73
74 const timeInfo = `${this.formatTime(elapsed)} | ETA: ${this.formatTime(eta * 1000)}`;
75
76 UIDisplay.text(
77 `${UIStyles.status.info(`[${current}/${total}]`)} ${progress} ${percentage}% - ${message} (${UIStyles.status.muted(timeInfo)})`
78 );
79 }
80
81 /**
82 * 创建简单的进度条字符串

Callers

nothing calls this directly

Calls 5

createProgressBarMethod · 0.95
formatTimeMethod · 0.95
mutedMethod · 0.80
textMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected