ConsoleProgressBar: Tries to be intelligent about start time even if the caller skips the first update.

This commit is contained in:
Jonathan Bernard 2015-06-28 07:35:26 -05:00
parent 4b4998026f
commit 14903c866c
2 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@ apply plugin: "groovy"
apply plugin: "maven" apply plugin: "maven"
group = "com.jdbernard" group = "com.jdbernard"
version = "3.6" version = "3.7"
repositories { repositories {
mavenCentral() } mavenCentral() }

View File

@ -19,7 +19,8 @@ class ConsoleProgressBar {
private long startTime private long startTime
void update(int value, String info) { void update(int value, String info) {
if (value == 0) startTime = System.currentTimeMillis() if (value == 0 || startTime == 0)
startTime = System.currentTimeMillis()
def curStep def curStep
def curPercent def curPercent