Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SampledTimer

A timer that stores the last n samples in a ring buffer.

internal

Hierarchy

Implements

Index

Constructors

constructor

Properties

maxNumSamples

maxNumSamples: number = 1000

Maximum samples until the statistics are reset and updated, which may destroy a median computation.

Readonly name

name: string

Name of the timer. Use colons to build a hierarchy.

numResets

numResets: number = 0

The number of times the timer has reset.

running

running: boolean = false

true if timer has been started.

samples

samples: RingBuffer<number> = new RingBuffer<number>(this.maxNumSamples)

The array of sampled values, its length cannot exceed maxNumSamples.

statistics

statistics: Statistics

Statistics to use for management.

Accessors

value

  • get value(): number | undefined

Methods

getStats

  • getStats(): Stats | undefined

now

  • now(): number

reset

  • reset(): void

setValue

  • setValue(val: number | undefined): void

start

  • start(): number

stop

  • stop(): number

Generated using TypeDoc