Limit time and memory usage from a function
Limit time and memory usage of a Python function
pip install flimit
from flimit.memory import limit_memory from flimit.time import limit_time @limit_memory(10**9) @limit_time(60) def f(...): # f will have a limit of 1 Go allocation memory and 60 seconds computation time ...
python -m pytest tests
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
flimit-1.0.0.tar.gz (1.9 kB view hashes)
flimit-1.0.0-py3-none-any.whl (2.1 kB view hashes)