Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
a5dae03897 | |||
|
57e9419565 |
@ -2,7 +2,7 @@ apply plugin: "groovy"
|
||||
apply plugin: "maven"
|
||||
|
||||
group = "com.jdbernard"
|
||||
version = "1.2"
|
||||
version = "1.2.2"
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Package
|
||||
|
||||
version = "1.2"
|
||||
version = "1.2.2"
|
||||
author = "Jonathan Bernard"
|
||||
description = "Utility for writing dynamic progress bars to the console."
|
||||
license = "BSD"
|
||||
@ -9,4 +9,3 @@ srcDir = "src/main/nim"
|
||||
# Dependencies
|
||||
|
||||
requires "nim >= 0.13.0"
|
||||
|
||||
|
@ -13,7 +13,7 @@ proc getMax*(pd: Progress): BiggestInt =
|
||||
proc setMax*(pd: Progress, maxValue: BiggestInt) =
|
||||
pd.maxValue = max(maxValue, 1)
|
||||
|
||||
proc newProgress*(sout: File, maxValue: BiggestInt): Progress =
|
||||
proc newProgress*(maxValue: BiggestInt, sout: File = stdout): Progress =
|
||||
return Progress(sout: sout,
|
||||
startTime: cpuTime(),
|
||||
lastStep: 0,
|
||||
@ -30,8 +30,8 @@ proc updateProgress*(pd: Progress, newValue: BiggestInt, info: string): void =
|
||||
|
||||
if info == pd.lastInfo and curStep == pd.lastStep: return
|
||||
|
||||
let curTime = cpuTime()
|
||||
let remTime = ((curTime / curPercent) - curTime) * 1000
|
||||
let curDuration = cpuTime() - pd.startTime
|
||||
let remTime = ((curDuration / curPercent) - curDuration)
|
||||
let displayedSteps = max(curStep - 1, 0)
|
||||
|
||||
pd.lastInfo = info
|
||||
|
Loading…
x
Reference in New Issue
Block a user