Instrumentation · class
FpsMeter
Explained in In-game tools.
class FpsMeterimport { FpsMeter } from '@driftengine/core';Constructor
new
constructor(options?: FpsMeterOptions)| Parameter | Type | Description |
|---|---|---|
options? | FpsMeterOptions |
Accessors
| Name | Type | Description |
|---|---|---|
fpsget | number | The rate this meter last computed, for a caller that wants the number as well as the panel.MoreReported from outside, by a consumer that had to keep its own average beside this one to say "the preview is below rate, the export is unaffected". A class that owns an element and refuses to say what it wrote in it makes every caller measure the same thing twice. These are what was last displayed, so they move at Zero until the first update, which is a real state and not a rate. |
meanMsget | number | Mean frame time in milliseconds over the window, as last displayed. See fps. |
worstMsget | number | The slowest frame in the window in milliseconds, as last displayed. See fps. |
Methods
sample
sample(frameDt: number, nowMs: number): voidCall once per rendered frame with duration in seconds.
| Parameter | Type | Description |
|---|---|---|
frameDt | number | |
nowMs | number |
dispose
dispose(): void