codetiming
A flexible, customizable timer for your Python code.
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
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 · maintenance · safety
permissive license (permissive) — Licensed under MIT (permissive), which allows free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
last release 2022-11-08 (1375 days) · last repo commit 2022-11-08 · 312 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,024,712 downloads/mo, #4,485 on PyPI
Alternatives
Verify before relying
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()- 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
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 on this page. Verify before relying on it.
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
codetiming on PyPI
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 | permissive license permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagedataclasses |
| Maintenance | Abandoned 1,375 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,024,712 / month, #4,485 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: MacOSOperating System :: MicrosoftOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: EducationTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: MonitoringTyping :: Typed |
Evidence: codetiming-1.4.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “python code timing”
- codetimingMeasures elapsed time in Python code using a flexible Timer class…
- stopwatch.pyProvides a simple stopwatch timer that measures elapsed time using…
- temporaProvides utilities, constants, and routines for working with dates,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also stopwatch.py · monotonic · line-profiler · interruptingcow · throttler · easydev · Autologging · pytest-timer · pytimeparse2 · waiter