Skip to main content

This package provides a decorator function `timejob` that can be used to measure the execution time of other functions in Python.

Project description

Timejob

This package provides a decorator function timejob that can be used to measure the execution time of other functions in Python.

Installation

You can install this package using pip:

pip install timejob

Usage

To use the timejob decorator, simply import it from the package and apply it to the function you want to measure:

from timejob import timejob

def fibonacci(n):
    if n <= 1:
        return n
    else:
        return fibonacci(n-1) + fibonacci(n-2)
    
@timejob
def show(value: int):
    result = fibonacci(value)
    print(f"result fibonacci:{result}")

show(1)
show(10)
show(20)

When you run my_function, the decorator will print the execution time in seconds to the console.

License This package is licensed under the MIT License

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

timejob-0.0.1.tar.gz (1.9 kB view hashes)

Uploaded Source

Built Distribution

timejob-0.0.1-py3-none-any.whl (2.8 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