MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / estimateRemainingTime

Method estimateRemainingTime

clean/clean.ts:558–568  ·  view source on GitHub ↗
(processed: number, total: number, elapsedMs: number)

Source from the content-addressed store, hash-verified

556 } catch (e) {
557 // 忽略编辑错误
558 }
559 }
560
561 private estimateRemainingTime(processed: number, total: number, elapsedMs: number): string {
562 if (processed === 0 || total === 0) return "计算中...";
563
564 const avgTimePerUser = elapsedMs / processed;
565 const remaining = total - processed;
566 const estimatedMs = avgTimePerUser * remaining;
567
568 if (estimatedMs < 1000) return "即将完成";
569 if (estimatedMs < 60000) return `约 ${Math.ceil(estimatedMs / 1000)} 秒`;
570 return `约 ${Math.ceil(estimatedMs / 60000)} 分钟`;
571 }

Callers 1

updateBlockedProgressMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected