Say I have a problem. There are three algorithms to solve that problem, name A, B, and C. Say that A is the baseline algorithm.
I would like to limit the run time to 10 seconds, but always allow algorithm A to finish. It means:
- If before 10 seconds, 1 or more algorithms finish: I take the best one (I can know which result is better).
- If 10 seconds always passed, I will wait until algorithm A finishes. It means that algorithm A must finish because otherwise there is no result to use.
I am consulting the page: How to limit execution time of a function call? but I think it does not answer my question directly.
Is there any Python library that can support me to do the task?