When using optimization algorithms in Python such as scipy.optimize.minimize() from the Scipy library, one can specify the maximum number of iterations via the optional argument "maxiter". However, I would rather like to restrict the total computation time of this algorithm, since I would like to use it in a time-critical application. The number of iterations is secondary.
Is there a way to restrict the maximum computation time in the Scipy optimization functions? If this means that the result is less accurate, that's fine.