1
0
mirror of https://github.com/nxshock/gwp.git synced 2024-11-27 03:31:02 +05:00

Show ETA for first period

This commit is contained in:
nxshock 2022-08-07 10:15:27 +05:00
parent a43e9e76b2
commit 0e63308e92

4
gwp.go
View File

@ -123,15 +123,13 @@ func (workerPool *WorkerPool) printProgress() error {
workerPool.errorCount, float64(workerPool.errorCount*100)/float64(workerPool.estimateCount)) workerPool.errorCount, float64(workerPool.errorCount*100)/float64(workerPool.estimateCount))
} }
if workerPool.currentSpeed > 0 {
if workerPool.estimateCount > 0 { if workerPool.estimateCount > 0 {
fmt.Fprintf(buf, " ETA: %s", fmtDuration(time.Until(workerPool.eta.Average()))) fmt.Fprintf(buf, " ETA: %s", fmtDuration(time.Until(workerPool.eta.Average())))
} }
if workerPool.ShowSpeed { if workerPool.currentSpeed > 0 && workerPool.ShowSpeed {
fmt.Fprintf(buf, " Speed: %.2f rps", workerPool.currentSpeed) fmt.Fprintf(buf, " Speed: %.2f rps", workerPool.currentSpeed)
} }
}
fmt.Fprint(buf, endLine) fmt.Fprint(buf, endLine)