Stat Unit calculation

Is it possible to access the stat unit values that are calculated by the engine? Both C++ and blueprint based solutions are acceptable.

I do real-time spawning of a large number of procedural meshes in my game. I have a “master” class which initializes these meshes during on tick. I noticed that “pausing” the initialization when the delta value of the tick is larger than some threshold helps with loading. I want to further increase this “pause” duration by basing it on the game thread time that is given by stat unit.

Further, would this calculation be disabled in shipping builds? If so, any suggestions on how I can do this calculation myself?

Thanks,

Did you ever find an answer for this? I’m looking for the exact same thing, and it’s disappointing that your question never got answered here.

EDIT: After some digging, I discovered the way to do this within C++:

If you include the “RHI.h” header, you can access the following variables:

FrameTime
GameThreadTime
RenderThreadTime
GPUFrameTime[0] (assuming you only have one GPU)
GNumDrawCallsRHI[0]
GNumPrimitivesDrawnRHI[0]

GetWorld()->GetGameViewport()->GetStatUnitData().
definition in GameViewportClient.h, look for GetStatUnitData();
FStatUnitData is defined in UnrealClient.h.