package io.quarkus.runtime.util;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;

import io.quarkus.runtime.StartupContext;

public class StepTiming {

    public static final String PRINT_STARTUP_TIMES = "quarkus.debug.print-startup-times";

    private static boolean stepTimingEnabled;
    private static long stepTimingStart;

    public static void configureEnabled() {
        stepTimingEnabled = System.getProperty(PRINT_STARTUP_TIMES, "false").equalsIgnoreCase("true");
    }

    public static void configureStart() {
        stepTimingStart = System.currentTimeMillis();
    }

    public static void printStepTime(StartupContext startupContext) {
        if (!stepTimingEnabled) {
            return;
        }
        long stepTimingStop = System.currentTimeMillis();
        String currentBuildStepName = startupContext.getCurrentBuildStepName();
        System.out.printf("%1$tF %1$tT,%1$tL Build step %2$s completed in: %3$sms%n",
                LocalDateTime.ofInstant(Instant.ofEpochMilli(stepTimingStop), ZoneId.systemDefault()),
                currentBuildStepName,
                stepTimingStop - stepTimingStart);
        stepTimingStart = System.currentTimeMillis();
    }
}

@@ -109,16 +109,54 @@
 .ZoneId;
+%0Aimport java.util.concurrent.TimeUnit;
 %0A%0Aimport
@@ -627,33 +627,24 @@
  System.
-currentTimeMillis
+nanoTime
 ();%0A    
@@ -784,66 +784,8 @@
   %7D%0A
-        long stepTimingStop = System.currentTimeMillis();%0A
     
@@ -1007,30 +1007,42 @@
 chMilli(
+Sy
 ste
-pTimingStop
+m.currentTimeMillis()
 ), ZoneI
@@ -1119,24 +1119,35 @@
     
-stepTimingStop -
+duration(System.nanoTime(),
  ste
@@ -1159,16 +1159,17 @@
 ngStart)
+)
 ;%0A      
@@ -1195,34 +1195,178 @@
  System.
-currentTimeMillis(
+nanoTime();%0A    %7D%0A%0A    private static long duration(long ended, long started) %7B%0A        return TimeUnit.MILLISECONDS.convert(ended - started, TimeUnit.NANOSECONDS
 );%0A    %7D

Use proper timing method in step timing