Get FPS or Delta time with Fixed FPS settings

Hi, my game uses fixed FPS settings. And I need to get current FPS, but I’m unable to do so. No matter how low the real FPS is, I am getting DeltaTime of 0.016, or 60 FPS. If I use stat fps console command, then I see real FPS (for example 30 FPS).

How can I get real delta time no matter if my FPS is set to fixed in project settings? My project is C++ and BP. So any solution would be good.

Thanks in advance

OK so, I tried to get the DeltaTime from my widget. And it seems like widget and actors have different delta time in case of fixed FPS. Anyone knows how to get that real delta time from actors? In the image below, you can see results of printing the delta time from Tick() functions inside of Actor, and inside of UIWidget.
image

Summary

GetWorldDeltaSeconds should always give you the actual frame time whereas Actors and Widgets can have their own custom Tick rate.

Hi, I tried GetWorldDeltaSeconds already. And if Fixed FPS is selected for poject settings, it’s always the same, no matter of real FPS.

You are right I got it backwards. GetWorldDeltaSeconds is manipulated by time dilation independent from frame time.

Using an Actor Tick where the Tick time is unchanged should be what you want.

Unfortunately no. Actor delta time gives me always same value (again, it is highly imprtant, if you test it our yourself, to set Fixed FPS in project settings). No matter of the FPS. This is why I’m now stunned on how to get this one :D. Only way to get real DeltaTime is to take DeltaTime from tick() method inside of Widget, then it’s good. And I haven’t changed tick interval for the widget. I’m now trying to get the same for my Actors as I need it for online game (to know FPS difference between client and server), since my game has PVP online, it matters.

OK, so after some more research, I found this variable in UnrealEngine.cpp.
ENGINE_API float GAverageFPS = 0.0f;

All you have to do is this to get it. extern ENGINE_API float GAverageFPS;

This will show you real FPS no matter if you have Fixed FPS, or variable FPS settings.

Then you can use it as much as you like. Hope it helps someone in the future.