Skip to main content

Limit time and memory usage from a function

Project description

Limit time and memory usage of a Python function

Installation

pip install flimit

Usage

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
    ...

Tests

python -m pytest tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flimit-1.0.0.tar.gz (1.9 kB view hashes)

Uploaded Source

Built Distribution

flimit-1.0.0-py3-none-any.whl (2.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page