class ProgressCounter extends java.lang.Object
Simple utility for displaying progress
The code doing the 'work' must call 'count' on the progress counter. This will print out a progress report at spaced repetitions (the default is every 500 counts or 30 seconds, whenever both of these are satisfied).
Optionally, the 'work' code can call "end()" when it is finished, which will then print out some brief summary statistics for the whole operation.
The timeInterval
and lineInterval
properties can be
set to control the frequency of output.
Type | Name and description |
---|---|
int |
count |
groovy.lang.Closure |
extra |
int |
lastPrintCount |
long |
lastPrintTimeMs |
int |
lineInterval |
java.util.logging.Logger |
log |
java.io.PrintStream |
out |
java.lang.String |
prefix |
long |
startTimeMs |
long |
timeInterval |
java.lang.Integer |
total Optional total: if provided, percentage progress can be displayed |
boolean |
withRate |
boolean |
withTime |
Constructor and description |
---|
ProgressCounter
() |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
count(groovy.lang.Closure c) |
|
void |
count(int num, groovy.lang.Closure c) |
|
void |
end() |
|
void |
getAbort() |
|
static java.lang.Object |
withProgress(java.util.Map options, groovy.lang.Closure c) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Optional total: if provided, percentage progress can be displayed
Groovy Documentation