Hi Uli,
I can think of different ways to implement this. One way without using a callback is, you could use a solution limit instead of a time limit. So the idea is:
Set the SolutionLimit parameter to 1
(
http://www.gurobi.com/documentation/5.6/reference-manual/solutionlimit#parameter:SolutionLimit)
call model.optimize()
after termination check status code and runtime,
if runtime is smaller than 5s,
set timelimit to 5s minus runtime and increase SolutionLimit
call model.optimize() again (it will start from where it stopped)
-- Sonja