Whether GPU timing is available in this context.
Begin timing a segment. No-op if unsupported or another segment is active.
End timing the current segment.
Smoothed elapsed milliseconds for a segment, or -1 if no result yet.
Harvest finished queries and update the smoothed timings. Call once per frame (e.g. at the top of the host pass's render). Disjoint frames (GPU context disruption) are discarded.
Snapshot of every segment's smoothed timing in milliseconds.
Tiny GPU timer for WebGL2 built on
EXT_disjoint_timer_query_webgl2.DEBUG-ONLY instrumentation: it brackets named, non-overlapping segments with
TIME_ELAPSEDqueries and reads the results back asynchronously (a few frames later), reporting a smoothed millisecond figure per segment. Because the GPU runs behind the CPU, results are never available the same frame they are issued, so a small ring of queries per segment is kept in flight.Only one timer query can be active at a time per spec, so begin/end calls must be strictly sequential (never nested). All methods are no-ops when the extension is unavailable (older browsers, or the WebGPU renderer), so call sites can leave instrumentation in place unconditionally.
This is measurement only — it issues no draws and mutates no render state — so it does not affect the rendered result and is safe to leave compiled in behind a flag.