Execy
The execy @exec_time decorator is a utility that measures the execution time of a function. It can be used to easily track and log the time taken by a function to execute, both for synchronous and asynchronous functions.
Table of Contents
Installation
pip install execy
Usage
To use the exec_time decorator, follow these steps:
from execy import exec_time
import asyncio
import time
@exec_time
def sync_function():
# Simulate a time-consuming synchronous task
time.sleep(2)
@exec_time
async def async_function():
# Simulate a time-consuming asynchronous task
await asyncio.sleep(2)
# Call the decorated synchronous function
sync_function()
# Call the decorated asynchronous function
asyncio.run(async_function())
The result will be
Function 'sync_function' executed in 2.0001089572906494 seconds.
Function 'async_function' executed in 2.001432180404663 seconds.
Release files for execy 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| execy-0.1.9.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| execy-0.1.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.6 kB
Release files / execy-0.1.9.tar.gz
| Download URL | execy-0.1.9.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c0bc0a9672880b72b17f2dbd4903106684573c910d3fb1605307eb5e78c6cd8
|
|
BLAKE2b-256 checksum How to use checksums |
f29f889e66d2400b15415bbff1ea73428fd0b3af97ced73a4dbb1381a0a676e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / execy-0.1.9-py3-none-any.whl
| Download URL | execy-0.1.9-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
17ab9b6d95fcf041f1bb3edd5839055bcdc9237afa3efa66ce155e33f4bc0929
|
|
BLAKE2b-256 checksum How to use checksums |
6dfed1711b9a036582fd799707db045c679af6462bf35121774460c6d12fa5d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|