private static Duration subtractDurations(Duration a, Duration b) {
      return new Duration(
          Math.max(0, a.getValue(NANOSECONDS) - b.getValue(NANOSECONDS)), NANOSECONDS);
    }
this class is copied from
https://github.com/airlift/airlift/blob/214/stats/src/main/java/io/airlift/stats/CpuTimer.java as
it doesn't support Java8.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/stats/CpuTimer.java