How can I get an output from GEKKO on how long it took to solve my model? I know based off of Measure time elapsed in Python that I can get my code to print the total time taken to run my code but I do not know how to isolate the solver time.
from gekko import GEKKO
import time
start = time.time()
m = GEKKO(remote=False)
x = m.Var(value=0)
y = m.Var(value=1)
m.Equations([x + 2*y==0, x**2+y**2==1])
s1 = time.time()
m.solve(disp=True)
e1 = time.time()
print([x.value[0],y.value[0]])
end = time.time()
print('Total Elapsed: ' + str(end-start))
print('Solver Time 1: ' + str(e1-s1))
Solver Time 1 is listed as 0.18468
sec but this is different than the IPOPT reported time of 0.0156
sec. How can I programmatically get the solver reported time?
EXIT: Optimal Solution Found.
The solution was found.
The final value of the objective function is 0.
---------------------------------------------------
Solver : IPOPT (v3.12)
Solution time : 0.0156 sec