Skip to content

Commit

Permalink
dont display fps if not in batch (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredroy authored May 30, 2023
1 parent c45e60d commit 0264155
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions exe/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ int main(int argc, char** argv)
auto targetNbIterations = result["nb_iterations"].as<std::size_t>();
if (targetNbIterations > 0)
{
msg_info("SofaGLFW") << "Computing " << targetNbIterations << " iterations.";
msg_info("SofaGLFW") << "Batch mode: computing " << targetNbIterations << " iterations.";
startAnim = true;
}

Expand All @@ -149,7 +149,12 @@ int main(int argc, char** argv)
const auto currentNbIterations = glfwGUI.runLoop(targetNbIterations);

const auto totalTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - currentTime).count() / 1000.0;
msg_info("SofaGLFW") << currentNbIterations << " iterations done in " << totalTime << " s ( " << ( static_cast<double>(currentNbIterations) / totalTime) << " FPS)." << msgendl;

// measurements only make sense in batch mode
if (targetNbIterations > 0)
{
msg_info("SofaGLFW") << currentNbIterations << " iterations done in " << totalTime << " s ( " << (static_cast<double>(currentNbIterations) / totalTime) << " FPS)." << msgendl;
}

if (groot != nullptr)
sofa::simulation::getSimulation()->unload(groot);
Expand Down

0 comments on commit 0264155

Please sign in to comment.