Skip to main content

timeitX - Function Execution Time Logger

Project description

timeitX - Function Execution Time Logger

Supported Python Versions GitHub issues PyPI version GitHub GitHub GitHub Downloads

timeitX is a Python decorator that logs the execution time of functions, both for synchronous and asynchronous functions.

Features

  • Log the execution time of functions.
  • Supports both synchronous and asynchronous functions.
  • Customizable function names for logging.
  • Precision down to milliseconds.
  • Easy to integrate with your Python projects.

Installation

You can install timeitX via pip:

pip install timeitX

Usage

from timeitX import timeitX

# Define your logger
import logging

logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')

logger = logging.getLogger("timeitX")

@timeitX(name="My Function", logger=logger)
def my_function():
    # Your function code here

# For asynchronous functions
@timeitX(name="Async Function", logger=logger)
async def async_function():
    # Your async function code here

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

timeitx-1.0.2.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

timeitx-1.0.2-py3-none-any.whl (11.2 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