Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PerformanceMonitor

Performance monitor tracks rolling average frame-time and frame-time variance over a user defined sliding-window

Hierarchy

  • PerformanceMonitor

Index

Constructors

constructor

  • constructor

    Parameters

    • Optional frameSampleSize: number

      The number of samples required to saturate the sliding window

    Returns PerformanceMonitor

Accessors

averageFPS

  • get averageFPS(): number
  • Returns the average framerate in frames per second over the sliding window (or the subset of frames sampled so far)

    Returns number

averageFrameTime

  • get averageFrameTime(): number
  • Returns the average frame time in milliseconds over the sliding window (or the subset of frames sampled so far)

    Returns number

averageFrameTimeVariance

  • get averageFrameTimeVariance(): number
  • Returns the variance frame time in milliseconds over the sliding window (or the subset of frames sampled so far)

    Returns number

instantaneousFPS

  • get instantaneousFPS(): number
  • Returns the average framerate in frames per second using the most recent frame time

    Returns number

instantaneousFrameTime

  • get instantaneousFrameTime(): number
  • Returns the frame time of the most recent frame

    Returns number

isEnabled

  • get isEnabled(): boolean
  • Returns true if sampling is enabled

    Returns boolean

isSaturated

  • get isSaturated(): boolean
  • Returns true if enough samples have been taken to completely fill the sliding window

    Returns boolean

Methods

disableSearch playground for disable

  • disable(): void
  • Disables contributions to the sliding window sample set Samples will not be interpolated over the disabled period

    Returns void

enableSearch playground for enable

  • enable(): void
  • Enables contributions to the sliding window sample set

    Returns void

resetSearch playground for reset

  • reset(): void
  • Resets performance monitor

    Returns void

sampleFrameSearch playground for sampleFrame

  • sampleFrame(timeMs?: number): void
  • Samples current frame

    Parameters

    • Optional timeMs: number

      A timestamp in milliseconds of the current frame to compare with other frames

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Static method