jaxvacua.util.exit_after#
- exit_after(s)#
Decorator factory: wrap a function to abort if its execution exceeds
sseconds. Internally arms athreading.Timerthat callsquit_function()to interrupt the main thread on expiry.- Parameters:
s (
int) – Timeout in seconds.- Returns:
Callable – A decorator.
- Return type:
Callable
Example
@exit_after(5) def slow(): ...