RealTime measurement : Set Absolute fixed time interval between two frame

Hej guy’s and lady’s, :slight_smile:

I’m a researcher who use Unity for is experimental setup.
I’ve a problem to record some data at a fixed time interval, and I need to be sure that those data are recorded at a constant time interval (RealTime measurement).

I’m actually using “FixedUpdate” but I discovered that there is always a little time uncertainty in the time interval between two measures (cf image). Uncertainty that I cannot accept in my current setup, as I’m running an FFT on those data just after. Do you know how to be sure that those data are recorded at a constant interval of time ?


Here Time.fixedDeltaTime= 0.05 and Time.maximumDeltaTime=Time.fixedDeltaTime.
The first graph show my registered sensor values, and the second graph the time interval between them.
As we see, the interval between my value is not constant.

By the way, I know this post is a duplicate of this one (my problem is more detailed there) :

As the subject of this topic is about both VR and Scripting, I thought I might have a better chance here.
I really sorry if it’s considered as a spam, because it’s really not the goal of it.

Many thanks

Waiting for all of your great solution.

Sincerely

kosen

Using Update or FixedUpdate there is no way to ensure that there is a constant REAL time difference.

There are all sorts of threads covering this… like here:

But yeah, the delta time is the time difference in simulated time, not real time.

If you need a REAL time step, you’re going to have to thread that yourself and have your own update pump. And of course, from said thread, you can’t access the unity API.

Thanks for your quick reply.
I’ll look at this threads :slight_smile: