Package org.apache.sling.commons.metrics

## Interface Timer

All Superinterfaces:
  `Counting`, `Metric`

    @ProviderType
    public interface Timer
    extends Counting, Metric

A timer metric which aggregates timing durations and provides duration statistics.

### Nested Class Summary

Nested Classes
`static interface` `Timer.Context` A timing context.

### Method Summary

All Methods Instance Methods Abstract Methods
`Timer.Context` `time()` Returns a new `Timer.Context`.
`void` `update​(long duration, TimeUnit unit)` Adds a recorded duration.

### Methods inherited from interface org.apache.sling.commons.metrics.Counting

`getCount`

### Methods inherited from interface org.apache.sling.commons.metrics.Metric

`adaptTo`

### Method Detail

#### update

    void update​(long duration,
                TimeUnit unit)

Adds a recorded duration.

Parameters:
  `duration` - the length of the duration
  `unit` - the scale unit of `duration`

#### time

    Timer.Context time()

Returns a new `Timer.Context`.

Returns:
  a new `Timer.Context`
See Also:
  `Timer.Context`