I am solving a MILP model in C++ using Gurobi 10.1. I retrieve the CPU time of my C++ program under Linux via the following commands:
clock_t start_time; double elapsed_time; start_time= clock(); model.optimize(); elapsed_time = (double) (clock() - start_time)/CLOCKS_PER_SEC;
Each time I solve the same problem instance with the same gurobi options and using only ONE thread, I get different CPU times; sometimes drastically different; for example 6500 sec vs. 3800 sec.
I do not understand why, in particular, since I use only one thread. CPU time is also significantly larger than the wall-clock time.
On the other hand, the wall-clock time remains stable.
Can somebody help me understand this and fix this issue?