--- id: stopwatch-py version: "2.0.1" license: MIT license_treatment: permissive maintenance: dormant --- # stopwatch.py — A simple stopwatch for python License: permissive · Maintenance: dormant · Downloads: 190.1K/mo ## What it is and what it does Stopwatch.py wraps Python's time.perf_counter() in a simple object-oriented interface for measuring elapsed time. It provides a Stopwatch class that can be instantiated, started, stopped, reset, and queried for the elapsed duration in seconds or as a formatted string. The package has no external dependencies and runs entirely in-process—there is no background task or thread; timing is purely mathematical arithmetic on the counter values. The package is designed for straightforward use cases where you need to measure how long a code block or operation takes. You can control decimal precision when converting to a string representation, and the stopwatch can be paused and resumed. It is lightweight enough for quick instrumentation but offers no advanced features like lap timing, multiple concurrent timers, or statistical aggregation. Use it for: - Measure execution time of a function or code block during development or debugging. - Track elapsed time in a game loop or animation to control frame timing. - Benchmark performance of different algorithms or implementations. - Monitor how long a background task or operation takes in a simple script. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a simple stopwatch timer that measures elapsed time using Python's high-resolution performance counter, with methods to start, stop, reset, and retrieve the duration. Yes, if you need a minimal, dependency-free timer. The package is straightforward and well-suited for quick timing tasks. However, note that maintenance is dormant—no updates since 2022-09-04—so expect no bug fixes or Python version support beyond what is already declared. For production code or long-term projects, consider whether a more actively maintained alternative or Python's built-in timeit module better fits your needs. ## Install pip install stopwatch-py uv add stopwatch-py poetry add stopwatch-py ## Installing stopwatch.py Before you install: Low install friction with no runtime dependencies. Dormant maintenance status since the latest release on 2022-09-04, though the repository remains active and unarchived. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open and closed-source projects. Quickstart: pip install stopwatch.py from stopwatch import Stopwatch stopwatch = Stopwatch(2) stopwatch.stop() print(stopwatch.duration) Requires Python 3.5 or later. Verify before relying: - Whether the package handles edge cases like repeated start/stop cycles or very long durations correctly. - Performance characteristics when timing very short intervals (microsecond-level precision). ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 190.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags python stopwatch timer, measure elapsed time, simple timing utility, performance counter wrapper, duration tracking, timing, benchmarking [View on SkillFed](https://skillfed.io/packages/stopwatch-py) · [View on PyPI](https://pypi.org/project/stopwatch-py/)