Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Timer

Hierarchy

  • Timer

Index

Constructors

Properties

Methods

Constructors

constructor

  • Allows you to time actions and log their runtimes to the console.

    constructor

    Returns Timer

Properties

Private _prefix

_prefix: any

Private _startTimes

_startTimes: any

Methods

end

  • end(key: string): number
  • Stops timing something.

    Parameters

    • key: string

      The key of the thing being timed.

    Returns number

endAndLog

  • endAndLog(key: string): void
  • Stops timing something and logs its runtime to the console.

    Parameters

    • key: string

      The key of the thing being timed.

    Returns void

setLogPrefix

  • setLogPrefix(prefix?: string): void
  • Sets the prefix to prepend to each line printed to the console.

    Parameters

    • Optional prefix: string

      The new prefix. 'DEBUG' is used if not defined.

    Returns void

start

  • start(key: string): void
  • Starts timing something.

    Parameters

    • key: string

      A unique key for the thing being timed.

    Returns void

Generated using TypeDoc