@Override public <RetType> RetType wrap(Supplier<RetType> sequenceProcessing) { final long start = JvmUtils.getCurrentThreadCpuTime(); try { return sequenceProcessing.get(); } finally { cpuTimeAccumulator.addAndGet(JvmUtils.getCurrentThreadCpuTime() - start); } }
public static long safeGetThreadCpuTime() { if (!isThreadCpuTimeEnabled()) { return 0L; } else { return getCurrentThreadCpuTime(); } }