Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

A package used to set time limits.

Project description

timework

python Build Status Coverage Status codebeat badge

A package used to set time limits.

Install

pip install timework

Usage

import timework as tw


@tw.timer(out=print)
def timer_demo():
    i = 0
    while i < 5000:
        i += 1


@tw.limit(timeout=1.5)
def limit_demo():
    i = 0
    while True:
        i += 1


@tw.progressive(timeout=2)
def progressive_demo(i, max_depth):
    for _ in range(max_depth):
        i += 1
    return i


timer_demo()

try:
    limit_demo()
except Exception as e:
    print(e)

try:
    progressive_demo(5, max_depth=10)
except Exception as e:
    rc = str(e)
    print(rc)

License

MIT 漏 bugstop

Project details


Download files

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

Files for timework, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size timework-0.0.3-py3-none-any.whl (4.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size timework-0.0.3.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page