Skip to content

Commit

Permalink
ProcessConsole: skip milliseconds while running.
Browse files Browse the repository at this point in the history
it's updating only once a second anyway
  • Loading branch information
EcljpseB0T authored and jukzi committed Sep 17, 2024
1 parent b0bb6df commit 210716b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,16 @@ protected String computeName() {
DateFormat dateTimeFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
Duration elapsedTime = Duration.between(launchTime != null ? launchTime.toInstant() : Instant.now(),
terminateTime != null ? terminateTime.toInstant() : Instant.now());
String elapsedString = String.format("%d:%02d:%02d.%03d", elapsedTime.toHours(), //$NON-NLS-1$
elapsedTime.toMinutesPart(), elapsedTime.toSecondsPart(), elapsedTime.toMillisPart());
String elapsedFormat = "%d:%02d:%02d.%03d"; //$NON-NLS-1$
if (terminateTime == null) {
// refresh every second:
DebugUIPlugin.getStandardDisplay().asyncExec(
() -> DebugUIPlugin.getStandardDisplay().timerExec(1000, () -> resetName(false)));
// pointless to update milliseconds:
elapsedFormat = "%d:%02d:%02d"; //$NON-NLS-1$
}
String elapsedString = String.format(elapsedFormat, elapsedTime.toHours(),
elapsedTime.toMinutesPart(), elapsedTime.toSecondsPart(), elapsedTime.toMillisPart());
if (launchTime != null && terminateTime != null) {
String launchTimeStr = dateTimeFormat.format(launchTime);
// Check if process started and terminated at same day. If so only print the
Expand Down

0 comments on commit 210716b

Please sign in to comment.