EXT_disjoint_timer_query: queryCounterEXT() method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Phương thức EXT_disjoint_timer_query.queryCounterEXT() của WebGL API ghi lại thời gian hiện tại vào đối tượng truy vấn tương ứng.

Cú pháp

js
queryCounterEXT(query, target)

Tham số

query

Một đối tượng WebGLQuery để ghi lại thời gian hiện tại.

target

Một GLenum chỉ định target của truy vấn thời gian. Phải là ext.TIMESTAMP_EXT.

Giá trị trả về

Không có (undefined).

Ví dụ

js
const ext = gl.getExtension("EXT_disjoint_timer_query");
const startQuery = ext.createQueryEXT();
const endQuery = ext.createQueryEXT();
ext.queryCounterEXT(startQuery, ext.TIMESTAMP_EXT);

// …

ext.queryCounterEXT(endQuery, ext.TIMESTAMP_EXT);

Thông số kỹ thuật

Specification
WebGL EXT_disjoint_timer_query Extension Specification

Tương thích trình duyệt

Xem thêm