So you only want to get the total solution time. You can just use Python's time package and the time.time() function to get a time stamp. With this you can easily calculate the elapsed time. This will also include any overhead there is between docplex and calling the engine. The raw engine solution time can be queried using
m.get_solve_details().time
assuming that m is an instance of Model and m.solve() was called before.
------------------------------
Daniel Junglas
------------------------------
Original Message:
Sent: Tue June 30, 2020 12:06 PM
From: Sajad Karimi
Subject: How can I get the elapsed time in DoCplex?
I want to solve a model by different parameters. So I wrote a loop and changed the parameters in every iteration and solved the model. I want to save the elapsed of solving the model in each iteration.
I know that I can get the value of objective function by "model.get_objective_value()", but I am not sure how to get the elapsed time for the model.
------------------------------
Sajad Karimi
Original Message:
Sent: Tue June 30, 2020 05:36 AM
From: Daniel Junglas
Subject: How can I get the elapsed time in DoCplex?
What exactly do you mean by "elapsed time in every iteration"? Do you mean simplex iteration?
------------------------------
Daniel Junglas
Original Message:
Sent: Tue June 30, 2020 01:53 AM
From: Sajad Karimi
Subject: How can I get the elapsed time in DoCplex?
Hello,
How can I get the elapsed time in DoCplex? (Other ways than log file). I need to save the elapsed time in every iteration.
------------------------------
Sajad Karimi
------------------------------
#DecisionOptimization