PerformanceMonitor

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

Hierarchy

  • PerformanceMonitor

Index

Constructors

constructor

Find examples in Playground
  • constructor

    Parameters

    • Optional frameSampleSize: number

      The number of samples required to saturate the sliding window

    Returns PerformanceMonitor

Properties

averageFPS

Find examples in Playground
averageFPS: number

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

averageFrameTime

Find examples in Playground
averageFrameTime: number

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

averageFrameTimeVariance

Find examples in Playground
averageFrameTimeVariance: number

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

instantaneousFPS

Find examples in Playground
instantaneousFPS: number

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

instantaneousFrameTime

Find examples in Playground
instantaneousFrameTime: number

Returns the frame time of the most recent frame

isEnabled

Find examples in Playground
isEnabled: boolean

Returns true if sampling is enabled

isSaturated

Find examples in Playground
isSaturated: boolean

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

Methods

disable

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

    Returns void

enable

Find examples in Playground
  • enable(): void
  • Enables contributions to the sliding window sample set

    Returns void

reset

Find examples in Playground
  • reset(): void
  • Resets performance monitor

    Returns void

sampleFrame

Find examples in Playground
  • 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