From 0e63308e921c02c9b896ec7b8a7c20d87c876850 Mon Sep 17 00:00:00 2001 From: nxshock Date: Sun, 7 Aug 2022 10:15:27 +0500 Subject: [PATCH] Show ETA for first period --- gwp.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/gwp.go b/gwp.go index e906130..fcd529a 100644 --- a/gwp.go +++ b/gwp.go @@ -123,14 +123,12 @@ func (workerPool *WorkerPool) printProgress() error { workerPool.errorCount, float64(workerPool.errorCount*100)/float64(workerPool.estimateCount)) } - if workerPool.currentSpeed > 0 { - if workerPool.estimateCount > 0 { - fmt.Fprintf(buf, " ETA: %s", fmtDuration(time.Until(workerPool.eta.Average()))) - } + if workerPool.estimateCount > 0 { + fmt.Fprintf(buf, " ETA: %s", fmtDuration(time.Until(workerPool.eta.Average()))) + } - if workerPool.ShowSpeed { - fmt.Fprintf(buf, " Speed: %.2f rps", workerPool.currentSpeed) - } + if workerPool.currentSpeed > 0 && workerPool.ShowSpeed { + fmt.Fprintf(buf, " Speed: %.2f rps", workerPool.currentSpeed) } fmt.Fprint(buf, endLine)