Measure execution time of model simulation

8 views
Skip to first unread message

Stephan MG

unread,
Jul 9, 2025, 9:21:49 AMJul 9
to COPASI User Forum
Dear all,

we are currently working with COPASI and imported SBML models for which we do time course simulations using the C++ API.

We would like to measure the time for simulation/solving the underlying ODE system with LSODA in COPASI.

For this we measure the elapsed time in ms as follows:

pTrajectoryTask->initialize(CCopasiTask::OUTPUT_UI, pDataModel, NULL);
auto start = std::chrono::high_resolution_clock::now();
 // now we run the actual trajectory
  pTrajectoryTask->process(true);
  auto end = std::chrono::high_resolution_clock::now();
   auto duration_ms = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count() / 1000.0; 

Is this correct? Or should something else be timed instead?

Kind regards,
Stephan
Reply all
Reply to author
Forward
0 new messages