Class: Timer

Timer()

new Timer()

Rendering timer.
Properties:
Name Type Description
gl WebGLRenderingContext The WebGL context.
cpuTimer Object Timer for CPU. Will be window.performance, if available, or window.Date.
gpuTimerQuery WebGLQuery Timer query object for GPU (if gpu timing is supported).
gpuTimerQueryInProgress boolean Whether a gpu timer query is currently in progress.
cpuStartTime number When the last CPU timing started.
cpuTime number Time spent on CPU during last timing. Only valid if ready() returns true.
gpuTime number Time spent on GPU during last timing. Only valid if ready() returns true. Will remain 0 if extension EXT_disjoint_timer_query_webgl2 is unavailable.
Source:

Methods

delete() → {Timer}

Delete this timer.
Source:
Returns:
The Timer object.
Type
Timer

end() → {Timer}

Stop timing.
Source:
Returns:
The Timer object.
Type
Timer

ready() → {boolean}

Check if timing results are available. If this method returns true, the cpuTime and gpuTime properties will be set to valid values.
Source:
Returns:
If results are available.
Type
boolean

restore() → {Timer}

Restore timer after context loss.
Source:
Returns:
The Timer object.
Type
Timer

start() → {Timer}

Start timing.
Source:
Returns:
The Timer object.
Type
Timer