Class MultiStageTimerInternal

Measures a sequence of connected events, such as multiple processing stages in a function.

Remarks

Each stage is identified with a timer name, that must be a valid timer in the statistics object. Additionally, all timers within a MultiStageTimer must be unique.

Internally, the MultiStageTimer manages a list of timers where at the end of each stage, one timer stops and the next timer starts.

Hierarchy

  • MultiStageTimer

Constructors

Properties

Accessors

Methods

Constructors

Properties

name: string

Name of this MultiStageTimer.

stages: string[]

List of timer names.

Accessors

  • get stage(): undefined | string
  • Gets the current stage.

    Returns undefined | string

  • set stage(stage): void
  • Sets the current stage. If a new stage is provided, the current timer (if available) is stopped, and the next timer is started. If the timer in the next stage is undefined, this is equivalent to calling stop on the MultiStageTimer.

    Parameters

    • stage: undefined | string

      The next stage to start.

    Returns void

  • get value(): undefined | number
  • Gets the timer value for the last stage. If the MultiStageTimer did not finish its last stage, the value is undefined.

    Returns undefined | number

Methods

Generated using TypeDoc