public static Optional<Duration> getProcessCpuTime() {
    Long result;
    Object obj = ManagementFactory.getOperatingSystemMXBean();
    try {
      result = callGetter(obj.getClass().getMethod("getProcessCpuTime"), obj, Long.class);
    } catch (NoSuchMethodException | InvocationTargetException e) {
      result = null;
    }
    return Optional
      .ofNullable(result)
      .map(Duration::ofNanos);
  }
Returns the amount of CPU time this processed hase used according to {@link OperatingSystemMXBean}, or empty if the
JVM does not support this.
planetiler-core/src/main/java/com/onthegomap/planetiler/stats/ProcessInfo.java