Is it possible to recreate the PlayerLoop hierarchy profiler in Builds?

I’m trying to create a custom profiler to see the performance inside builds and I want to recreate the same hierarchy tree as the one in profiler CPU usage with the calls and milliseconds.

All the info I see in documentation and forums is to use the line```ProfilerRecorder.StartNew(ProfilerCategory.Internal, “Main Thread”, 15);

1 Like

ProfilerRecorder api allows you to the the total time of a particular marker for the whole frame. The usecase for this is to have timings for a selected activities/areas in your game.

If you would like to capture all instrumentation events in Unity you can use native IUnityProfilerCallbacks API callbacks. That way you can measure all timings yourself and build a similar view inside and outside builds.

2 Likes

Thank you!

Hi again.
How can I receive the native code callbacks in my C# scripts?
E.g. How can I get the info from RegisterCreateMarkerCallback in my C# script?