Skip to content

Commit 42a1fd3

Browse files
authored
only printout if interval is positive (#1421)
1 parent e983c40 commit 42a1fd3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

common-tools/clas-utils/src/main/java/org/jlab/utils/benchmark/ProgressPrintout.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ public void showStatus(){
5555
}
5656

5757
public void updateStatus(){
58-
if (++this.numberOfCalls < WARMUP_CALLS) {
58+
if (++this.numberOfCalls < WARMUP_CALLS){
5959
this.previousPrintoutTime = System.currentTimeMillis();
6060
this.startPrintoutTime = this.previousPrintoutTime;
6161
}
62-
else {
62+
else if(this.printoutIntervalSeconds > 0){
6363
Long currentTime = System.currentTimeMillis();
6464
Double elapsedTime = (currentTime - this.previousPrintoutTime)*1e-3;
65-
if(elapsedTime >= this.printoutIntervalSeconds){
65+
if(elapsedTime >= this.printoutIntervalSeconds) {
6666
this.previousPrintoutTime = System.currentTimeMillis();
6767
System.out.println(this.getUpdateString());
6868
}

0 commit comments

Comments
 (0)