Allows stopwatch style measurements.
Allows stopwatch style measurements.
Starts a context that can be later stopped.
Should only be used when full control of start and end are needed.
Returns a StartStopTimer
with the method stop
to register the measurement.
Adds a recorded duration
Measures 'now' up to the moment that the given future
completes, then updates this timer with the measurement.
Measures 'now' up to the moment that the given future
completes, then updates this timer with the measurement.
This method may measure more than is obvious.
It measures:
* the evaluation of the (by name) parameter future
* in case the future is not yet completed: the delay until the constructed Future is scheduled in the
given ExecutionContext
* in case the future is not yet completed: the actual execution of the Future
* the time it takes to schedule stopping the timer
Source: https://github.com/erikvanoosten/metrics-scala/blob/c20187a1ed09f50a523b310e3a7ffa992564afb3/metrics-scala/src/main/scala/nl/grons/metrics4/scala/Timer.scala#L60
Runs f and recording its duration
A timer measures both the rate that a particular piece of code is called and the distribution of its duration.