Real time at the beginning of the frame

Hello, I am interested in the real time elapsed in the game at the beginning of the frame. I see in the documentation that Time.time almost does that. Just it is affected by time scale. Time.realTimeSinceStartup will unfortunately not work because it just uses the system clock. We could be accessing the system clock several milliseconds after the frame has already been displaying on the screen.

The reason is that I am programming a psychology experiment and I want to know when a stimulus is drawn to the screen. With vsync, I am hoping that the beginning of the frame and the display time will line up pretty well.

What kind of accuracy do you need?

The WaitForEndOfFrame event will give you timing for when the current frame gets passed to the video card. Unforunately there will be a delay between that timing and when the frame actually appears on your monitor and this delay is not necessarily consistent or easy to measure.

Take a look at this question and the answers to it for more information: