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

Properties

averageFPS

averageFPS: number

Returns the average framerate in frames per second over the sliding window (or the subset of frames sampled so far)

returns

Framerate in frames per second

averageFrameTime

averageFrameTime: number

Returns the average frame time in milliseconds over the sliding window (or the subset of frames sampled so far)

returns

Average frame time in milliseconds

averageFrameTimeVariance

averageFrameTimeVariance: number

Returns the variance frame time in milliseconds over the sliding window (or the subset of frames sampled so far)

returns

Frame time variance in milliseconds squared

instantaneousFPS

instantaneousFPS: number

Returns the average framerate in frames per second using the most recent frame time

returns

Framerate in frames per second

instantaneousFrameTime

instantaneousFrameTime: number

Returns the frame time of the most recent frame

returns

Frame time in milliseconds

isEnabled

isEnabled: boolean

Returns true if sampling is enabled

returns

true if enabled

isSaturated

isSaturated: boolean

Returns true if enough samples have been taken to completely fill the sliding window

returns

true if saturated

Methods

disable

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

    Returns void

enable

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

    Returns void

reset

  • reset(): void
  • Resets performance monitor

    Returns void

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

Generated using TypeDoc