--- id: codetiming version: "1.4.0" license: unclear license_treatment: permissive maintenance: abandoned --- # codetiming — A flexible, customizable timer for your Python code. License: permissive · Maintenance: abandoned · Downloads: 1.0M/mo ## What it is and what it does codetiming provides a Timer class for measuring code execution time in Python. It supports three usage patterns—as a standalone class with explicit start/stop calls, as a context manager for timing code blocks, and as a decorator for timing function calls. The Timer accepts optional arguments to customize output formatting (via a text template), redirect output to a logger function, and optionally display text when the timer starts. The package includes named timer aggregation: when you create a Timer with a name, elapsed times accumulate in a class-level dictionary (Timer.timers) that provides statistics methods like mean, median, min, max, stdev, and count. The text formatting is template-based using .format() rather than f-strings, and can be a callable for custom time formatting. A single runtime dependency on dataclasses ensures compatibility with older Python versions. Use it for: - Measure execution time of specific code blocks during development and debugging without external profiling tools - Track performance of repeated operations and gather statistics (mean, max, stdev) across multiple runs - Add timing instrumentation to functions using decorators for quick performance monitoring - Redirect timer output to logging frameworks instead of print for integration with application logging - Benchmark different implementations by timing them with named timers and comparing accumulated statistics ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Measures elapsed time in Python code using a flexible Timer class that works as a decorator, context manager, or standalone object, with customizable output formatting and named timer aggregation. Yes, if you need a lightweight, zero-configuration timer for development and learning. The package is stable and has no known vulnerabilities, but install with the understanding that it is no longer maintained—no bug fixes or feature updates will be released. For production performance monitoring, consider a more actively maintained alternative. ## Install pip install codetiming uv add codetiming poetry add codetiming ## Installing codetiming Before you install: Installation is straightforward with no compiled dependencies. However, the package has been abandoned since November 2022 (over 1375 days without updates), so no active maintenance or bug fixes should be expected. License in practice: Licensed under MIT (permissive), which allows free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects. Quickstart: from codetiming import Timer # As a context manager with Timer(name="example"): # Code to time pass # As a decorator @Timer(name="function") def my_function(): pass # As a class t = Timer() t.start() # Code to time elapsed = t.stop() Verify before relying: - Whether the package works correctly with Python versions beyond 3.11 despite no recent releases - Current compatibility with modern Python async/await patterns - Whether accumulated timer data in Timer.timers persists correctly across different execution contexts ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 1.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags python code timing, measure execution time, performance profiling decorator, context manager timer, elapsed time tracking, profiling, benchmarking, development-tools [View on SkillFed](https://skillfed.io/packages/codetiming) · [View on PyPI](https://pypi.org/project/codetiming/)