Fixed bug calculating remaining time in Nim implementation.
This commit is contained in:
parent
f4dcfd2a24
commit
57e9419565
@ -2,7 +2,7 @@ apply plugin: "groovy"
|
|||||||
apply plugin: "maven"
|
apply plugin: "maven"
|
||||||
|
|
||||||
group = "com.jdbernard"
|
group = "com.jdbernard"
|
||||||
version = "1.2"
|
version = "1.2.1"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "1.2"
|
version = "1.2.1"
|
||||||
author = "Jonathan Bernard"
|
author = "Jonathan Bernard"
|
||||||
description = "Utility for writing dynamic progress bars to the console."
|
description = "Utility for writing dynamic progress bars to the console."
|
||||||
license = "BSD"
|
license = "BSD"
|
||||||
|
@ -30,8 +30,8 @@ proc updateProgress*(pd: Progress, newValue: BiggestInt, info: string): void =
|
|||||||
|
|
||||||
if info == pd.lastInfo and curStep == pd.lastStep: return
|
if info == pd.lastInfo and curStep == pd.lastStep: return
|
||||||
|
|
||||||
let curTime = cpuTime()
|
let curDuration = cpuTime() - pd.startTime
|
||||||
let remTime = ((curTime / curPercent) - curTime) * 1000
|
let remTime = ((curDuration / curPercent) - curDuration)
|
||||||
let displayedSteps = max(curStep - 1, 0)
|
let displayedSteps = max(curStep - 1, 0)
|
||||||
|
|
||||||
pd.lastInfo = info
|
pd.lastInfo = info
|
||||||
|
Loading…
x
Reference in New Issue
Block a user