implementation/src/main/java/io/smallrye/metrics/app/SimpleTimerImpl.java
public void update(Duration duration) {
        if (duration.compareTo(Duration.ZERO) > 0) {
            maybeStartNewMinute();
            synchronized (this) {
                count.increment();
                elapsedTime.add(duration.toNanos());
                Duration currentMax = max_thisMinute.get();
                if (currentMax == null || (duration.compareTo(currentMax) > 0)) {
                    max_thisMinute.set(duration);
                }
                Duration currentMin = min_thisMinute.get();
                if (currentMin == null || (duration.compareTo(currentMin) < 0)) {
                    min_thisMinute.set(duration);
                }
            }
        }
    }
/**
     * Adds a recorded duration.
     *
     * @param duration the length of the duration
     */
Adds a recorded duration.
@param duration the length of the duration
Adds a recorded duration . @param duration the length of the duration
public void update(Duration duration) {
        if (duration.compareTo(Duration.ZERO) > 0) {
            maybeStartNewMinute();
            synchronized (this) {
                count.increment();
                elapsedTime.add(duration.toNanos());
                Duration currentMax = max_thisMinute.get();
                if (currentMax == null || (duration.compareTo(currentMax) > 0)) {
                    max_thisMinute.set(duration);
                }
                Duration currentMin = min_thisMinute.get();
                if (currentMin == null || (duration.compareTo(currentMin) < 0)) {
                    min_thisMinute.set(duration);
                }
            }
        }
    }
public void update ( Duration duration ) { if ( duration . compareTo ( Duration . ZERO ) > 0 ) { maybeStartNewMinute ( ) ; synchronized ( this ) { count . increment ( ) ; elapsedTime . add ( duration . toNanos ( ) ) ; Duration currentMax = max_thisMinute . get ( ) ; if ( currentMax == null || ( duration . compareTo ( currentMax ) > 0 ) ) { max_thisMinute . set ( duration ) ; } Duration currentMin = min_thisMinute . get ( ) ; if ( currentMin == null || ( duration . compareTo ( currentMin ) < 0 ) ) { min_thisMinute . set ( duration ) ; } } } }
Adds a recorded duration.
Adds a recorded duration .