Registry / observability / about-time

about-time

JSON →
library4.2.2pypypi✓ verified 23d ago

Easily measure timing and throughput of code blocks, with beautiful human friendly representations. It offers highly readable output for durations and counts, supporting various units from nanoseconds to days, and is particularly useful for profiling iterable operations like generators. The current version is 4.2.2, with active development indicated by frequent releases.

pip install about-time
INSTALL
IMPORT
SIG · ABOUT-TIME
A
about-time
observabilitypythonv4.2.2
Install
1.5s avg
Import
109ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.2.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.116s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.102s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

about_time
from about_time import about_time

Demonstrates basic usage with a context manager and advanced usage for profiling iterables/generators, showing human-readable output and direct attribute access.

import time from about_time import about_time # Example 1: Basic timing with a context manager with about_time('Doing some work'): time.sleep(0.123) _ = [x * x for x in range(1000000)] # Example 2: Timing an iterable (e.g., a generator) def my_generator(n): for i in range(n): time.sleep(0.001) yield i with about_time('Processing generator items') as t: total_sum = sum(my_generator(10)) print(f'Total sum: {total_sum}') # Accessing detailed results after the block print(f"Duration: {t.duration_human}") print(f"Throughput: {t.throughput_human}")
Debug
Known issues
breakingVersion 4.2.2 dropped support for Python 3.7. Ensure your environment is Python 3.8 or newer for compatibility.
fix
Upgrade to Python 3.8+ or pin `about-time` to a version <4.2.2 if Python 3.7 is required.
affects: >=4.2.2
breakingVersion 4.0.0 introduced significant changes to the API and output, including new global features, new objects for each operation, and simpler human-friendly representations. Code written for pre-4.0 versions may require adaptation.
fix
Refer to the official documentation for migration guidelines if upgrading from versions prior to 4.0.0.
affects: >=4.0.0
gotchaPrior to version 4.2.2, the `precision` parameter for output formatting was not truly optional, potentially causing unexpected behavior. This was fixed in 4.2.2.
fix
Upgrade to version 4.2.2 or higher to ensure the `precision` parameter behaves as expected.
affects: <4.2.2
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'about_time'
The 'about-time' package is not installed in the Python environment.
fix
Install the package using pip: 'pip install about-time'.
ImportError: cannot import name 'about_time'
Attempting to import 'about_time' directly instead of the correct function or class from the package.
fix
Use the correct import statement: 'from about_time import about_time'.
AttributeError: module 'about_time' has no attribute 'about_time'
Incorrect import statement; 'about_time' is a function within the 'about_time' module, not an attribute.
fix
Import the function correctly: 'from about_time import about_time'.
ModuleNotFoundError: No module named 'about-time'
The package name for installation uses a hyphen (`about-time`), but Python import statements require underscores (`about_time`).
fix
Change the import statement from `import about-time` to `from about_time import about_time` or `import about_time`.
TypeError: 'int' object is not callable
When using `about_time` to measure a callable, a non-callable object (like an integer) was passed directly to it, expecting it to be executed.
fix
Ensure that the argument passed to `about_time()` in callable mode is indeed a callable object (e.g., a function, a lambda, or a method).
Upgrade
Version history
4.2.2latest on PyPI · released Jul 23, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
62 hits · last 30 days
node
54
OpenAI (training)
1
Resources
about-time — pip install about-time · libregistry