Allows to measure keys of type T with a Stopwatch.

Measure with start, measure or measureAsync, retrieve the final measurements with get.

Type Parameters

  • T

Constructors

Methods

  • Retrieve all measure-results, requires that all stop-watches that have been started have also been stopped.

    Returns Map<T, bigint>

  • Similar to measure, but await the promise as part of the measurement

    Type Parameters

    • Out

    Parameters

    • key: T

      The key to write the resulting measurement to

    • fn: (() => Promise<Out>)

      The function to measure

        • (): Promise<Out>
        • Returns Promise<Out>

    Returns Promise<Out>

    measure