mirror of
https://github.com/nxshock/gwp.git
synced 2024-11-27 03:31:02 +05:00
Do now print new line if no progress requested
This commit is contained in:
parent
35416cd502
commit
5b2fc6d56d
8
gwp.go
8
gwp.go
@ -48,10 +48,16 @@ func New(threadCount int) *WorkerPool {
|
||||
tickerCalculateEta.Stop()
|
||||
}()
|
||||
|
||||
fmt.Fprintf(os.Stderr, endLine)
|
||||
newLined := false
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-tickerUpdateText.C:
|
||||
if !newLined {
|
||||
fmt.Fprintf(os.Stderr, endLine)
|
||||
newLined = true
|
||||
}
|
||||
|
||||
workerPool.printProgress()
|
||||
case <-tickerCalculateEta.C:
|
||||
workerPool.currentSpeed = float64(workerPool.processedCount-prevPos) * float64(time.Second) / float64(time.Now().Sub(prevTime))
|
||||
|
Loading…
Reference in New Issue
Block a user