From d3a1ca72d80626dec2c0979523e67062d5c9e85f Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Mon, 7 Oct 2024 02:36:50 -0700 Subject: [PATCH] Report memory usage in simulate using percentage rather than decimal fraction. PiperOrigin-RevId: 683098469 Change-Id: I7310848fb87e040996fcfc24991d45bf55872993 --- simulate/simulate.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simulate/simulate.cc b/simulate/simulate.cc index 877366d5..a3433f23 100644 --- a/simulate/simulate.cc +++ b/simulate/simulate.cc @@ -603,7 +603,7 @@ void UpdateInfoText(mj::Simulate* sim, const mjModel* m, const mjData* d, // prepare info text mju::strcpy_arr(title, "Time\nSize\nCPU\nSolver \nFPS\nMemory"); mju::sprintf_arr(content, - "%-9.3f\n%d (%d con)\n%.3f\n%.1f (%d it)\n%s\n%.2g of %s", + "%-9.3f\n%d (%d con)\n%.3f\n%.1f (%d it)\n%s\n%.1g%% of %s", d->time, d->nefc, d->ncon, sim->run ? @@ -611,7 +611,7 @@ void UpdateInfoText(mj::Simulate* sim, const mjModel* m, const mjData* d, d->timer[mjTIMER_FORWARD].duration / mjMAX(1, d->timer[mjTIMER_FORWARD].number), solerr, solver_niter, fps, - d->maxuse_arena/(double)(d->narena), + 100*d->maxuse_arena/(double)(d->narena), mju_writeNumBytes(d->narena)); // add Energy if enabled