A utility class for measuring the duration of operations and recording the observed duration in the associated histogram.
Records the duration of the operation and returns the elapsed time.