FixedUpdate() executes at a constant rate, but in what timescale?

I think this is really an easy question, but I’m not sure of the answer after reading the documentation.

When the documentation says that FixedUpdate() is executed at a constant rate, with standard value of 50 times per second, does it mean a real-time second or a simulated-time second?

I understand the Physics engine cannot guarantee a periodic execution, so the time refers to simulated time, and the engine simply calculates what would be the new position of the objects 0.02 “simulated” seconds after the last engine step, although maybe the last step was executed 0.03 “real” seconds ago. Then it waits at least another 0.02 “real” seconds before executing the next step.

Am I right?

It refers to game time, not real time.

Its also worth noting that FixedUpdate only appears to run at a fixed time step. In reality it runs after Update. It runs as many times as needed in order to catch the physics time up to the game time. So if you have a long Update, FixedUpdate might run three times in quick succession at the end to catch up.

I only mention this because some people think they can do things that require an actual fixed time step, like run time sound generation, in FixedUpdate. Doesn’t work.

It’s real time. So, 50 times per second means every 2ms. However, if your script code takes 15 hours to execute per frame, it’s impossible to do a fixed update every 2ms. The assumption is that Update() happens faster than FixedUpdate().