Skip to content

Commit 210716b

Browse files
EcljpseB0Tjukzi
authored andcommitted
ProcessConsole: skip milliseconds while running.
it's updating only once a second anyway
1 parent b0bb6df commit 210716b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,16 @@ protected String computeName() {
337337
DateFormat dateTimeFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
338338
Duration elapsedTime = Duration.between(launchTime != null ? launchTime.toInstant() : Instant.now(),
339339
terminateTime != null ? terminateTime.toInstant() : Instant.now());
340-
String elapsedString = String.format("%d:%02d:%02d.%03d", elapsedTime.toHours(), //$NON-NLS-1$
341-
elapsedTime.toMinutesPart(), elapsedTime.toSecondsPart(), elapsedTime.toMillisPart());
340+
String elapsedFormat = "%d:%02d:%02d.%03d"; //$NON-NLS-1$
342341
if (terminateTime == null) {
342+
// refresh every second:
343343
DebugUIPlugin.getStandardDisplay().asyncExec(
344344
() -> DebugUIPlugin.getStandardDisplay().timerExec(1000, () -> resetName(false)));
345+
// pointless to update milliseconds:
346+
elapsedFormat = "%d:%02d:%02d"; //$NON-NLS-1$
345347
}
348+
String elapsedString = String.format(elapsedFormat, elapsedTime.toHours(),
349+
elapsedTime.toMinutesPart(), elapsedTime.toSecondsPart(), elapsedTime.toMillisPart());
346350
if (launchTime != null && terminateTime != null) {
347351
String launchTimeStr = dateTimeFormat.format(launchTime);
348352
// Check if process started and terminated at same day. If so only print the

0 commit comments

Comments
 (0)