Skip to main content

k3stopwatch

Action-CI Documentation Status Package

StopWatch - library for adding timers and tags in your code for performance monitoring

k3stopwatch is a component of pykit3 project: a python3 toolkit set.

StopWatch operates on a notion of "spans" which represent scopes of code for which we want to measure timing. Spans can be nested and placed inside loops for aggregation.

StopWatch requires a root scope which upon completion signifies the end of the round of measurements. On a server, you might use a single request as your root scope.

StopWatch produces two kinds of reports.

  1. Aggregated (see _reported_values).
  2. Non-aggregated or "tracing" (see _reported_traces).

Install

pip install k3stopwatch

Synopsis

import k3stopwatch

sw = k3stopwatch.StopWatch()

with sw.timer("rwoot"):
    for i in range(50):
        with sw.timer("inner_task"):
            print("do_inner_task(i)")

Author

Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Copyright and License

The MIT License (MIT)

Copyright (c) 2015 Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Metadata

Release files for k3stopwatch 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for k3stopwatch 0.2.1
File Size Uploaded
k3stopwatch-0.2.1.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for k3stopwatch 0.2.1
File Interpreter ABI Platform
k3stopwatch-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.0 kB

Release files / k3stopwatch-0.2.1.tar.gz

Download URL k3stopwatch-0.2.1.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1583280959d0ac95d8b551fac9fd2233c7e49240efe15c728832d20cb494ec64
BLAKE2b-256 checksum
How to use checksums
9b96ccec576b2ad0f7a7470891822d9c4444f70ab812f7bac00dea2a837cf308
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / k3stopwatch-0.2.1-py3-none-any.whl

Download URL k3stopwatch-0.2.1-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4ba7066414f3173870c41f9b8a8cba0e840725a3574b4fd5109cd439d4d94be
BLAKE2b-256 checksum
How to use checksums
6ac545c3136f6dabaa51b000ef79b2aae12eb8c0b969c895e73659d63dd9c88a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release history Release notifications | RSS feed

0.2.3

2 release files

0.2.2

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page