public long taskDuration() {
        if (isDone()) {
            return endedTime() - scheduledTime();
        }
        throw new IllegalStateException("Task is not done yet");
    }
@return the time in millis it took to execute the task from the moment it was scheduled.
httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/HttpRequestFutureTask.java