I profile a metal shader using both Frame Capture Debugging Tools and addCompletedHandler method of command buffer.
The frame capture tool shows me that my shader costs 2.7ms (differs between 2.5ms-3ms for executing multiple times).
And the command buffer I use following code:
The executionDuration shows about 5ms. What the difference between these two time duration?
The frame capture tool shows me that my shader costs 2.7ms (differs between 2.5ms-3ms for executing multiple times).
And the command buffer I use following code:
Code Block [commandBuffer addCompletedHandler:^(id<MTLCommandBuffer> cb) { CFTimeInterval executionDuration = cb.GPUEndTime - cb.GPUStartTime; // print executionDuration to console }];
The executionDuration shows about 5ms. What the difference between these two time duration?