title: Gurobi: Get optimization runtime
body: <p>I would like to access the <strong>time</strong> it took to find the optimal solution of model <code>m</code> when running a mathematical optimization problem in gurobi from python.</p>
  
  <p>So far I use </p>
  
  <pre><code>runtime = m.Runtime
  print("The run time is %f" % runtime)
  </code></pre>
  
  <p>Unfortunately, the returned runtime is always 0.0, independent of the time it took to solve the model, and before any timelimit is reached.</p>
  
  <pre><code>    m.setParam("TimeLimit", timeLimit)
  </code></pre>
  
  <p>How can the actual runtime be accessed in gurobi via gurobipy? I have read the <a href="http://www.gurobi.com/documentation/5.6/reference-manual/runtime" rel="nofollow">Gurobi reference manual</a> but without success.</p>