public static long microsBetween(Instant start, Instant end) {
    long secsDiff = Math.subtractExact(end.getEpochSecond(), start.getEpochSecond());
    long totalMicros = Math.multiplyExact(secsDiff, MICROS_PER_SECOND);
    return Math.addExact(totalMicros, (end.getNano() - start.getNano()) / NANO_PER_MICRO);
  }
Returns the microseconds between two instants. If jdk version less than 18 there is a bug in
calculating microsecond intervals between two times using methods like
'ChronoUnit.MICROS.between(start, end)', this method is used instead. see: <a
href="https://bugs.openjdk.org/browse/JDK-8273369">...</a>
amoro-format-mixed/amoro-mixed-hive/src/main/java/org/apache/amoro/hive/utils/TimeUtil.java