Real-time factor

On this page 7

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 valueMeaningTypical situation
Below 0.5Simulation is heavily slowedMany robots, dense meshes or camera rendering
0.5 to 0.95Slower than realityComplex contact scenes on a desktop machine
About 1.0Locked to wall-clock timeTeleoperation, hardware-in-the-loop, demos
1.0 to 10Faster than realityHeadless runs with simple models
Above 10Massively acceleratedBatched GPU physics for reinforcement learning
Interpreting common real-time factor values

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.

ParameterEffect on RTFTrade-off
Physics step sizeLarger steps raise RTFLower accuracy and possible instability
Solver iterationsFewer iterations raise RTFSofter, less precise contacts
Collision geometrySimple primitives raise RTFLess faithful contact shapes
Rendered sensorsCameras and lidar lower RTFNeeded for perception testing
Number of agentsMore robots lower RTFRequired for fleet scenarios
Headless modeDisabling the GUI raises RTFNo live visual inspection
Parameters that influence the real-time factor

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 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.

ConceptWhat it measuresRelation to RTF
Real-time factorSimulated time per wall-clock timeThe reference metric itself
Physics step rateSteps computed per real secondRTF equals step rate times step size
Rendering frame rateImages drawn per real secondCan be decoupled from physics
Real-time systemGuaranteed deadlines for tasksRTF of 1.0 gives no deadline guarantee
Simulation speedupAggregate throughput across instancesSum of RTF over parallel environments
Real-time factor versus neighboring timing concepts

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 caseTarget RTFReason
Teleoperation and demosLocked at 1.0Operators expect natural motion
Hardware-in-the-loopExactly 1.0 with low jitterPhysical devices run on real clocks
Software-in-the-loop testingAs high as stableShortens regression test cycles
Reinforcement learningHundreds to thousands aggregatePolicies need millions of samples
Contact-accurate validationBelow 1.0 is acceptableAccuracy outweighs speed
Recommended real-time factor by use case

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.