Timing commands in Metal?

155 Views Asked by At

I would like to time the execution time of a commited Metal command buffer. However I need more finegrained timing information for each of the commands in the queue and I dont know how to get this information out.

Is there a way to discover the length of time each enqueued command takes when running a Metal command queue?

A simple brute force way to do so would be to sequentially load up each command, run the buffer, find the time up to that point, rerun but with an extra command and continue in this way until I have a cumulative array of values and then just find the difference of each. However this feels very hacky for something which might potentially be easy and I just cannot find the function call.

0

There are 0 best solutions below