The resolveQuerySet() method of the GPUCommandEncoder interface encodes a command that resolves a GPUQuerySet, copying the results into a specified GPUBuffer. 
 
resolveQuerySet(querySet, firstQuery, queryCount, destination, destinationOffset)
 
The following criteria must be met when calling resolveQuerySet(), otherwise a GPUValidationError is generated and the GPUCommandEncoder becomes invalid:
  - The destination.buffer'sGPUBuffer.usageincludes theGPUBufferUsage.QUERY_RESOLVEflag.
- 
firstQueryis smaller than the number of queries inquerySet.
- 
firstQuery+queryCountis smaller than or equal to the number of queries inquerySet.
- 
destinationOffsetis a multiple of 256.
- 
destinationOffset+ 8 ×queryCountis less than or equal todestination.size.
 
const queryBuffer = device.createBuffer({
  size: 1024,
  usage: GPUBufferUsage.QUERY_RESOLVE,
});
const querySet = device.createQuerySet({
  type: "timestamp",
  count: 32,
});
const commandEncoder = device.createCommandEncoder();
commandEncoder.writeTimestamp(querySet, 0);
commandEncoder.writeTimestamp(querySet, 1);
commandEncoder.resolveQuerySet(
  querySet,
  0, 
  16, 
  queryBuffer,
  0, 
);