{"id":2370,"library":"about-time","title":"about-time","description":"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.","status":"active","version":"4.2.2","language":"python","source_language":"en","source_url":"https://github.com/rsalmei/about-time","tags":["timing","profiling","performance","human-readable","context-manager","iterator","generator"],"install":[{"cmd":"pip install about-time","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"about_time","correct":"from about_time import about_time"}],"quickstart":{"code":"import time\nfrom about_time import about_time\n\n# Example 1: Basic timing with a context manager\nwith about_time('Doing some work'):\n    time.sleep(0.123)\n    _ = [x * x for x in range(1000000)]\n\n# Example 2: Timing an iterable (e.g., a generator)\ndef my_generator(n):\n    for i in range(n):\n        time.sleep(0.001)\n        yield i\n\nwith about_time('Processing generator items') as t:\n    total_sum = sum(my_generator(10))\n    print(f'Total sum: {total_sum}')\n\n# Accessing detailed results after the block\nprint(f\"Duration: {t.duration_human}\")\nprint(f\"Throughput: {t.throughput_human}\")","lang":"python","description":"Demonstrates basic usage with a context manager and advanced usage for profiling iterables/generators, showing human-readable output and direct attribute access."},"warnings":[{"fix":"Upgrade to Python 3.8+ or pin `about-time` to a version <4.2.2 if Python 3.7 is required.","message":"Version 4.2.2 dropped support for Python 3.7. Ensure your environment is Python 3.8 or newer for compatibility.","severity":"breaking","affected_versions":">=4.2.2"},{"fix":"Refer to the official documentation for migration guidelines if upgrading from versions prior to 4.0.0.","message":"Version 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.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Upgrade to version 4.2.2 or higher to ensure the `precision` parameter behaves as expected.","message":"Prior 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.","severity":"gotcha","affected_versions":"<4.2.2"}],"env_vars":null,"search_vec":"'4.2.2':47 'about-tim':1 'activ':49 'beauti':13 'block':11 'code':10 'context':62 'context-manag':61 'count':25 'current':44 'day':32 'develop':50 'durat':23 'easili':4 'frequent':53 'friend':15 'generat':42,65 'high':19 'human':14,59 'human-read':58 'indic':51 'iter':39,64 'like':41 'manag':63 'measur':5 'nanosecond':30 'offer':18 'oper':40 'output':21 'particular':35 'perform':57 'profil':38,56 'readabl':20,60 'releas':54 'represent':16 'support':26 'throughput':8 'time':3,6,55 'unit':28 'use':36 'various':27 'version':45","created_at":"2026-04-11T01:25:16.905657+00:00","updated_at":"2026-04-15T19:04:37.415271+00:00","problems":[{"fix":"Install the package using pip: 'pip install about-time'.","cause":"The 'about-time' package is not installed in the Python environment.","error":"ModuleNotFoundError: No module named 'about_time'"},{"fix":"Use the correct import statement: 'from about_time import about_time'.","cause":"Attempting to import 'about_time' directly instead of the correct function or class from the package.","error":"ImportError: cannot import name 'about_time'"},{"fix":"Import the function correctly: 'from about_time import about_time'.","cause":"Incorrect import statement; 'about_time' is a function within the 'about_time' module, not an attribute.","error":"AttributeError: module 'about_time' has no attribute 'about_time'"},{"fix":"Change the import statement from `import about-time` to `from about_time import about_time` or `import about_time`.","cause":"The package name for installation uses a hyphen (`about-time`), but Python import statements require underscores (`about_time`).","error":"ModuleNotFoundError: No module named 'about-time'"},{"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).","cause":"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.","error":"TypeError: 'int' object is not callable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"4.2.2","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/rsalmei/about-time","docs":null,"changelog":null,"pypi":"https://pypi.org/project/about-time/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["observability","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-28","next_check":"2026-07-28","install_tag":null}}