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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

timejob-0.0.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file timejob-0.0.1.tar.gz.

File metadata

  • Download URL: timejob-0.0.1.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for timejob-0.0.1.tar.gz
Algorithm Hash digest
SHA256 32032295e8026b8f9333e9b393067c1f168aaae0ed3d6a4378227fddb143414f
MD5 b773bc8fb951679fbd99f49fada8fe03
BLAKE2b-256 54c4d6ea845bfc727b2686fc6da34bcb80aba995afba037563763d9ddb9ad21b

See more details on using hashes here.

File details

Details for the file timejob-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: timejob-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for timejob-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a47595d7da5c71fa26e469b519029ced0180ec9aa67de48b0c82990e451adc97
MD5 eee8e93eaa3063388e1daa167a0c8c7c
BLAKE2b-256 878a1538aab984925a8a585d7cd5f167c8aff878f4db74f65ee07cbb403f33c6

See more details on using hashes here.

Supported by

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