diff --git a/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/Timing.java b/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/Timing.java index 0b49df0aed47d..9295104cca85a 100644 --- a/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/Timing.java +++ b/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/Timing.java @@ -3,6 +3,7 @@ import io.quarkus.bootstrap.graal.ImageInfo; import io.quarkus.bootstrap.logging.InitialConfigurator; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.logging.Handler; import org.jboss.logging.Logger; @@ -133,8 +134,8 @@ public static void printStopTime(String name, boolean auxiliaryApplication) { public static BigDecimal convertToBigDecimalSeconds(final long timeNanoSeconds) { final BigDecimal secondsRepresentation = BigDecimal.valueOf(timeNanoSeconds) // As nanoseconds - .divide(BigDecimal.valueOf(1_000_000), BigDecimal.ROUND_HALF_UP) // Convert to milliseconds, discard remaining digits while rounding - .divide(BigDecimal.valueOf(1_000), 3, BigDecimal.ROUND_HALF_UP); // Convert to seconds, while preserving 3 digits + .divide(BigDecimal.valueOf(1_000_000), RoundingMode.HALF_UP) // Convert to milliseconds, discard remaining digits while rounding + .divide(BigDecimal.valueOf(1_000), 3, RoundingMode.HALF_UP); // Convert to seconds, while preserving 3 digits return secondsRepresentation; }