Skip to main content

Simple utilities to time synchronous and asynchronous Python functions.

Project description

timing-utils

Simple utilities to time the execution of synchronous and asynchronous Python functions.

Installation

pip install timing-utils

Usage

from timing_utils import timeit, async_timeit

@timeit
def fast_func():
    return sum(range(10000))

@async_timeit
async def slow_async_func():
    import asyncio
    await asyncio.sleep(1)

# Example of running the async function (in an async environment):
# await slow_async_func()

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a new branch: git checkout -b feature/your-feature-name
  3. Make your changes and add tests if needed
  4. Run tests locally: make test
  5. Submit a pull request

Please follow the existing coding style and include relevant documentation if applicable.

License

This project 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

timing_utils-0.1.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

timing_utils-0.1.3-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

File details

Details for the file timing_utils-0.1.3.tar.gz.

File metadata

  • Download URL: timing_utils-0.1.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for timing_utils-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5fead9db5f939dff9846b23575e5e8a86e9198d60c9a1aa933196a79986633ac
MD5 6733a3d2dc14ec6edece9c65805d0bd6
BLAKE2b-256 07855d5ca8c293af620815d0ab92b216eb4f3b92a97b8823745a2aaad6de8b20

See more details on using hashes here.

File details

Details for the file timing_utils-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: timing_utils-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 2.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for timing_utils-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 35396a2a4929db4a93116e49365452f8ef078a6b6b0a54c01936668a12250422
MD5 5f256b8491c41eedb8f54dab9e858a71
BLAKE2b-256 24b007fcfcee8c60ae1937115b41aeaa4100d891b71fca5d279e5799d7b75ff6

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