{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/7"},{"label":"Monitoring","url":"https://skillfed.io/packages/category/system-monitoring/3"},{"label":"Education","url":"https://skillfed.io/packages/category/education"}],"enrichment":{"capability":"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.","skillfed_tags":["profiling","benchmarking","development-tools"],"use_cases":["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"],"what_it_does":"codetiming provides a Timer class for measuring code execution time in Python. It supports three usage patterns\u2014as 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.\n\nThe 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.","worth_installing":"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\u2014no bug fixes or feature updates will be released. For production performance monitoring, consider a more actively maintained alternative."},"id":"codetiming","links":{"html":"https://skillfed.io/packages/codetiming","md":"https://skillfed.io/packages/codetiming.md","pypi":"https://pypi.org/project/codetiming/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2022-11-08","license_spdx":null,"license_treatment":"permissive","name":"codetiming","python_support":"supports_current","summary":"A flexible, customizable timer for your Python code."},"popularity":{"monthly_downloads":1024712,"position":4485,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.4.0"}
