Profiling Burst job over multiple frames

Is there a way I can record how long a Burst job takes when it lasts more than one frame? I tried using ProfilerMarker with ProfilerRecorder, and with Recorder, but it only records the time spent in the first frame of the job (I assume since Begin is only getting called in the first frame). I have jobs running algorithms on complex geometry which can last many frames and I am trying to record the total time each job takes. In the Profiler window you can see how many frames the job took and clicking on gives the total time, but I can’t find a way to get the same information in a script. Looking in the profiler window is not a practical option when I am trying to compare timing results.

It would be nice if it is possible to record the time in release builds too, but from searching the forums it doesn’t look like that is possible without DateTime support.

Regarding the DateTime support to make a timer; you can use this: Unity - Scripting API: Unity.Profiling.LowLevel.Unsafe.ProfilerUnsafeUtility.Timestamp
to build a makeshift Stopwatch equivalent

1 Like