-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show time elapsed for all tasks and use Duration for the duration and…
… eta. (#1771) * Show time elapsed for all tasks and use Duration for the duration and eta. * Fix tests. * Rename duration and eta to elapsedTime and remainingTime and fix ETA in the console progress listener.
- Loading branch information
Showing
7 changed files
with
85 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,23 +17,25 @@ | |
*/ | ||
package se.llbit.util; | ||
|
||
import java.time.Duration; | ||
|
||
/** | ||
* Progress listener. | ||
* | ||
* @author Jesper Öqvist <[email protected]> | ||
*/ | ||
public interface ProgressListener { | ||
ProgressListener NONE = (task, done, start, target) -> {}; | ||
ProgressListener NONE = (task, done, start, target, duration) -> {}; | ||
|
||
/** | ||
* Update progress without ETA. | ||
*/ | ||
void setProgress(String task, int done, int start, int target); | ||
void setProgress(String task, int done, int start, int target, Duration elapsedTime); | ||
|
||
/** | ||
* Update progress with ETA. | ||
*/ | ||
default void setProgress(String task, int done, int start, int target, String eta) { | ||
setProgress(task, done, start, target); | ||
default void setProgress(String task, int done, int start, int target, Duration elapsedTime, Duration remainingTime) { | ||
setProgress(task, done, start, target, elapsedTime); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters