From 14903c866ce6c02bf965fac55a0c1a9aab845602 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Sun, 28 Jun 2015 07:35:26 -0500 Subject: [PATCH] ConsoleProgressBar: Tries to be intelligent about start time even if the caller skips the first update. --- build.gradle | 2 +- src/main/groovy/com/jdbernard/util/ConsoleProgressBar.groovy | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index b146926..9eb3517 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: "groovy" apply plugin: "maven" group = "com.jdbernard" -version = "3.6" +version = "3.7" repositories { mavenCentral() } diff --git a/src/main/groovy/com/jdbernard/util/ConsoleProgressBar.groovy b/src/main/groovy/com/jdbernard/util/ConsoleProgressBar.groovy index 94876e9..ddf6301 100644 --- a/src/main/groovy/com/jdbernard/util/ConsoleProgressBar.groovy +++ b/src/main/groovy/com/jdbernard/util/ConsoleProgressBar.groovy @@ -19,7 +19,8 @@ class ConsoleProgressBar { private long startTime void update(int value, String info) { - if (value == 0) startTime = System.currentTimeMillis() + if (value == 0 || startTime == 0) + startTime = System.currentTimeMillis() def curStep def curPercent