Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Statistics

Manages a set of timers.

remarks

The main objective of Statistics is to log these timers. You can disable statistics to minimize their impact on performance.

internal

Hierarchy

  • Statistics

Index

Constructors

constructor

  • new Statistics(name?: undefined | string, enabled?: boolean): Statistics
  • Sets up a group of timers.

    Parameters

    • Optional name: undefined | string

      The statistics name, for logging purposes.

    • Default value enabled: boolean = false

      If false, the timers do not measure the performance.

    Returns Statistics

Properties

enabled

enabled: boolean

If false, the timers do not measure the performance.

Optional name

name: undefined | string

The statistics name, for logging purposes.

Methods

addTimer

createTimer

  • createTimer(name: string, keepSamples?: boolean): Timer

getTimer

  • getTimer(name: string): Timer

hasTimer

  • hasTimer(name: string): boolean
  • Checks if a timer with the specified name already exists.

    Parameters

    • name: string

      The timer's name.

    Returns boolean

    true if a timer with name already exists; false otherwise.

log

  • log(header?: undefined | string, footer?: undefined | string): void
  • Prints all values to the console.

    Parameters

    • Optional header: undefined | string

      Optional header line.

    • Optional footer: undefined | string

      Optional footer line.

    Returns void

reset

  • reset(): void

Generated using TypeDoc