public long averageDuration() {
            final long counter = count.get();
            return counter > 0 ? cumulativeDuration.get() / counter : 0;
        }
A counter that can measure duration and number of events.
httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/FutureRequestExecutionMetrics.java