title: Python Gurobi: Output MIPGap, Runtime and solving details before optimization stops
body: <p>I am using Gurobi to solve a MIP problem, and I want to see how its MIPGap changes with respect to the Runtime. Is there any efficient way to collect these two information? The callback code does not provide MIPGap, and I don't know how to retrieve this attribute before the model terminates (get optimal solution).</p>
  <p>Also, how could we output the MIP solving details (how it gets around the perceived non-convexity etc.) after it completes preprocessing?</p>
  <p>Below are the codes that I am currently applying for gap and runtime:</p>
  <pre class="lang-py prettyprint-override"><code>def mycallback(m, where):
      if where == GRB.Callback.MIPSOL:
          time=m.cbGet(GRB.Callback.RUNTIME);
          a=m.cbGet(GRB.Callback.MIPSOL_OBJBST);
          b=m.cbGet(GRB.Callback.MIPSOL_OBJBND);
          gap=(b-a)/abs(a)*100;
  
  model.optimize(mycallback)          
  
  </code></pre>
  <p>Thank you very much!</p>
  <p>Best,
  Grace</p>