This would be a solver feature, so it would depend on the solver that you are using. I would guess that you are looking for this option in a solver that handles integer variables by building a search tree, and hence often finds an optimal solution long before that solution is proved to be (within some percentage of) optimal.
None of these solvers returns the amount of time up to the point where the best solution was found, however. I think the solver developers do not consider this to be a useful measure in practical optimization. The only way to get an approximation of this timing is to have the solver display a node log (such as with "option gurobi_options 'outlev 1';") and then look at the time that is reported at or near the log line for the best solution that was found.
Bob Fourer
4...@ampl.com
=======