public String timesUsed() {
        StringBuilder buf = new StringBuilder();
        buf.append("[");
        Instant prev = startTime;
        for (Measurement m : measurements) {
            if ( ! m.label().isEmpty()) {
                buf.append(m.label()).append(": ");
            }
            buf.append(Duration.between(prev, m.timestamp()).toMillis())
                    .append(" ms")
                    .append(", ");
            prev = m.timestamp();
        }
        Instant now = clock.instant();
        buf.append("total: ");
        buf.append(Duration.between(startTime, now).toMillis());
        buf.append(" ms]");
        return buf.toString();
    }
Handles a timeout logic by providing higher level abstraction for asking if there is time left.

@author Ulf Lilleengen
configserver/src/main/java/com/yahoo/vespa/config/server/TimeoutBudget.java