Real-time factor (RTF) is the ratio between the simulated time that elapses inside a physics engine and the wall-clock time needed to compute it. In robotics simulation, an RTF of 1.0 means the simulator keeps pace with reality, a value below 1.0 means it runs slower than real time, and a value above 1.0 means it runs faster.
The metric matters because robot software rarely runs in isolation: controllers, sensor drivers, planners and learning loops all assume some relationship between simulated seconds and real seconds. Tools such as Gazebo, Webots, MuJoCo and Isaac Sim report or target RTF in different ways, so interpreting the number correctly is a basic skill for anyone running a robot simulator.
How the real-time factor is calculated
The real-time factor is computed as simulated time divided by wall-clock time over a measurement window. If a simulator advances 10 seconds of simulated time in 20 seconds of real time, the RTF is 0.5; if it advances the same 10 seconds in 2 seconds, the RTF is 5.0.
Simulated time advances in discrete physics steps, each of fixed size, for example 1 ms or 4 ms. The engine performs collision detection, constraint solving and integration for every step, and rendering or sensor generation adds further cost. The RTF therefore depends on step size multiplied by achieved steps per second: a 1 ms step executed 1,000 times per real second gives exactly 1.0.
Most simulators report a smoothed average rather than an instantaneous value, because individual steps vary in cost. Contact-rich moments, such as a gripper closing on an object, can briefly slow the loop even when the average looks healthy, so short windows reveal spikes that long averages hide.
The table below shows how typical RTF values are interpreted in practice.
| RTF value | Meaning | Typical situation |
|---|---|---|
| Below 0.5 | Simulation is heavily slowed | Many robots, dense meshes or camera rendering |
| 0.5 to 0.95 | Slower than reality | Complex contact scenes on a desktop machine |
| About 1.0 | Locked to wall-clock time | Teleoperation, hardware-in-the-loop, demos |
| 1.0 to 10 | Faster than reality | Headless runs with simple models |
| Above 10 | Massively accelerated | Batched GPU physics for reinforcement learning |
What determines the achievable RTF
The achievable real-time factor is limited by the total computational cost per simulated second. That cost grows with model complexity, solver settings and every sensor that must be produced, and it shrinks with faster hardware or parallel execution.
The following table summarizes the main parameters and their effect on RTF.
| Parameter | Effect on RTF | Trade-off |
|---|---|---|
| Physics step size | Larger steps raise RTF | Lower accuracy and possible instability |
| Solver iterations | Fewer iterations raise RTF | Softer, less precise contacts |
| Collision geometry | Simple primitives raise RTF | Less faithful contact shapes |
| Rendered sensors | Cameras and lidar lower RTF | Needed for perception testing |
| Number of agents | More robots lower RTF | Required for fleet scenarios |
| Headless mode | Disabling the GUI raises RTF | No live visual inspection |
Collision meshes are a frequent bottleneck. A detailed visual mesh used directly for collision can multiply contact computation, whereas a convex decomposition or primitive shapes keep the cost predictable. Likewise, ray-traced cameras in Isaac Sim or high-resolution depth sensors in Gazebo can dominate the frame budget regardless of how simple the physics is.
Real-time factor compared with related timing concepts
Real-time factor is often confused with frame rate, step rate and real-time computing, yet each measures something different. Clear separation of these ideas prevents misleading performance claims.
| Concept | What it measures | Relation to RTF |
|---|---|---|
| Real-time factor | Simulated time per wall-clock time | The reference metric itself |
| Physics step rate | Steps computed per real second | RTF equals step rate times step size |
| Rendering frame rate | Images drawn per real second | Can be decoupled from physics |
| Real-time system | Guaranteed deadlines for tasks | RTF of 1.0 gives no deadline guarantee |
| Simulation speedup | Aggregate throughput across instances | Sum of RTF over parallel environments |
The distinction between an average RTF of 1.0 and true real-time determinism is critical. A simulator may average 1.0 while individual steps occasionally take twice as long, which is acceptable for visualization but not for hardware-in-the-loop simulation, where a physical controller expects sensor data at a fixed cadence.
Choosing a target RTF for the task
The right target depends on who or what consumes simulated time. When humans or real hardware participate, the simulation must be paced to wall-clock time; when only software participates, faster execution simply saves hours.
| Use case | Target RTF | Reason |
|---|---|---|
| Teleoperation and demos | Locked at 1.0 | Operators expect natural motion |
| Hardware-in-the-loop | Exactly 1.0 with low jitter | Physical devices run on real clocks |
| Software-in-the-loop testing | As high as stable | Shortens regression test cycles |
| Reinforcement learning | Hundreds to thousands aggregate | Policies need millions of samples |
| Contact-accurate validation | Below 1.0 is acceptable | Accuracy outweighs speed |
Many simulators expose a real-time update rate or a pacing option. Gazebo, for example, can throttle stepping so the RTF never exceeds 1.0, or run unthrottled to go as fast as possible. Robot software must use simulated time, typically through a clock topic such as the ROS use_sim_time parameter, otherwise timers and controllers drift as soon as RTF departs from 1.0.
Common mistakes and limitations
Most problems with real-time factor arise from mismatched clocks or from chasing speed at the expense of fidelity. The following errors appear repeatedly in robotics projects.
- Mixing wall-clock and simulated time in nodes, which makes controllers misbehave whenever RTF is not exactly 1.0.
- Raising the step size to reach 1.0, which can cause joint jitter, tunneling through thin objects and unstable grasps.
- Reporting a single average RTF for benchmarks without noting hardware, sensors and scene complexity.
- Assuming an RTF above 1.0 is always good, even though rendering pipelines may then skip sensor frames.
- Ignoring per-step jitter in hardware-in-the-loop setups, where occasional long steps break timing contracts.
RTF also says nothing about physical accuracy. A simulator can run at 50 times real time with a coarse model and still produce trajectories that fail on a real robot, so RTF should always be read together with validation against measured behavior.
A non-technical view
Think of a robot simulator as a video game that tries to follow the laws of physics. The real-time factor tells you how fast the game clock moves compared with a real clock. At 1.0 the two clocks match. At 0.5 the simulated world moves in slow motion, and at 10 it races ahead like a fast-forwarded film.
Slow motion is fine when nobody is watching and accuracy matters. Fast-forward is ideal when a computer is learning by trial and error. Matching the real clock matters most when a person or a real machine is connected to the simulation and expects things to happen on time.
A concrete example
A warehouse robotics team simulates a mobile manipulator that picks boxes from shelves. With two depth cameras, a lidar and detailed collision meshes, Gazebo reports an RTF of about 0.4 on a workstation, so a one-hour shift test takes two and a half hours of real time.
The engineers replace the shelf meshes with box primitives, lower the camera resolution for regression runs and run the simulator headless. The RTF rises to about 1.8 without changing the 1 ms step, and nightly tests finish in roughly half the time.
For hardware-in-the-loop sessions with the real arm controller, they keep the full sensor set but enable pacing at 1.0 and monitor step jitter. The outcome is a faster test pipeline for software changes and reliable timing whenever physical hardware is in the loop.