* 显示带时间的进度
(
current: number,
total: number,
message: string,
startTime: number
)
| 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 | * 创建简单的进度条字符串 |
nothing calls this directly
no test coverage detected