diff --git a/python/mujoco/viewer.py b/python/mujoco/viewer.py index 9784691f..67d65e89 100644 --- a/python/mujoco/viewer.py +++ b/python/mujoco/viewer.py @@ -298,6 +298,7 @@ def _physics_loop(simulate: _Simulate, loader: Optional[_InternalLoaderType]): # Run mj_forward, to update rendering and joint sliders. mujoco.mj_forward(m, d) + synccpu = time.time() def _launch_internal( diff --git a/simulate/main.cc b/simulate/main.cc index 55c09dee..509f4187 100644 --- a/simulate/main.cc +++ b/simulate/main.cc @@ -392,6 +392,7 @@ void PhysicsLoop(mj::Simulate& sim) { else { // run mj_forward, to update rendering and joint sliders mj_forward(m, d); + syncCPU = mj::Simulate::Clock::now(); } } } // release std::lock_guard