FrameTime stat from CSV Profiler is one frame late in 5.8.0-preview1

The timings for FrameTime produced by CSV Profiler seem to be recorded one frame late in 5.8.0-preview1 and are out of sync with timers emitted on the Game Thread. I have seen this when running SequenceTests from AutomatedPerfTesting, but I am not sure if it’s related to it or it’s an issue with the CSV Profiler itself. This behavior is different from 5.7.4 where the times of FrameTime line up with the other emitted timers (e.g. peak on the same frame).

Is this an intended behavior (and if it is, what’s the rationale) or is it a bug?

Steps to Reproduce

  • Build the attached project in the Test configuration
  • Run the contained APT sequence with "RunUAT.bat RunUnreal -Project=<path>\APTTest.uproject -Configuration=Test -Platform=Win64 -Build=<path_to_build> -ResumeOnCriticalFailure -Test=“AutomatedPerfTest.SequenceTest” -“AutomatedPerfTest.DoCSVProfiler” -“AutomatedPerfTest.IgnoreTestBuildLogging”
  • Inspect the generated CSV file under Saved\Performance\SequenceTest\Perf\Win64\CSV. Some timers will show 3 peaks: peaks for FrameTime are shown one row below/one frame later (32, 62, 92) than the other impacted timers (e.g. ActorSpawning, GameThreadTime which peak at 31, 61, 91)

Hello!

The change is coming from CL51427117. This is an attempt to increase the accuracy of the measurement when using frame rate limiters. I found an internal discussion about the change and it outlines the fact that the timers where already misaligned as some of them are computed the middle of the frame (GameThreadTime ).

Regards,

Martin

I found out there is a Cvar that restores the previous behavior: csv.UseLegacyFrameTime

Thanks [mention removed]​, the CVar should work well enough for my case!