From 57e94195650a9277430f605087563ae08a4a1688 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Tue, 26 Jan 2016 01:10:57 -0600 Subject: [PATCH] Fixed bug calculating remaining time in Nim implementation. --- build.gradle | 2 +- console_progress.nimble | 2 +- src/main/nim/console_progress.nim | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 16a21e1..4872614 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: "groovy" apply plugin: "maven" group = "com.jdbernard" -version = "1.2" +version = "1.2.1" repositories { mavenLocal() diff --git a/console_progress.nimble b/console_progress.nimble index 9c11670..c487463 100644 --- a/console_progress.nimble +++ b/console_progress.nimble @@ -1,6 +1,6 @@ # Package -version = "1.2" +version = "1.2.1" author = "Jonathan Bernard" description = "Utility for writing dynamic progress bars to the console." license = "BSD" diff --git a/src/main/nim/console_progress.nim b/src/main/nim/console_progress.nim index 0d6f197..5f611b9 100644 --- a/src/main/nim/console_progress.nim +++ b/src/main/nim/console_progress.nim @@ -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