Interface Measurement

A Measurement counts the time elapsed between its creation when the Stopwatch is started and when it is stopped.

interface Measurement {
    elapsed?: number;
    name: string;
    debug(detail, ...optionalArgs): void;
    error(detail, ...optionalArgs): void;
    info(detail, ...optionalArgs): void;
    log(detail, ...optionalArgs): void;
    stop(): number;
    warn(detail, ...optionalArgs): void;
}

Properties

Methods

Properties

elapsed?: number

The elapsed time measured, if it has been stopped and measured, or NaN if the platform disabled performance measurement.

name: string

The measurement name. This may show up in the performance measurement framework appropriate to the application context.

Methods

  • Compute the elapsed time and log a debug message annotated with that timing information.

    Parameters

    • detail: string

      a message detailing what activity was measured

    • Rest ...optionalArgs: any[]

      optional message arguments as per the usual console API

    Returns void

  • Compute the elapsed time and log an error message annotated with that timing information.

    Parameters

    • detail: string

      a message detailing what activity was measured

    • Rest ...optionalArgs: any[]

      optional message arguments as per the usual console API

    Returns void

  • Compute the elapsed time and log an info message annotated with that timing information.

    Parameters

    • detail: string

      a message detailing what activity was measured

    • Rest ...optionalArgs: any[]

      optional message arguments as per the usual console API

    Returns void

  • Compute the elapsed time and log a message annotated with that timing information. The message is logged at the level determined by the MeasurementOptions.

    Parameters

    • detail: string

      a message detailing what activity was measured

    • Rest ...optionalArgs: any[]

      optional message arguments as per the usual console API

    Returns void

  • Compute the elapsed time, in milliseconds, if not already done (only has effect on the first invocation). A NaN result indicates that the watch was stopped but failed to make a measurement.

    Returns number

  • Compute the elapsed time and log a warning message annotated with that timing information.

    Parameters

    • detail: string

      a message detailing what activity was measured

    • Rest ...optionalArgs: any[]

      optional message arguments as per the usual console API

    Returns void