No project description provided
Project description
Hand profiler
Install
$ pip install handprofiler
Example of use
from time import sleep
from random import random
import handprofiler as profiler
@profiler.track("foo")
def foo():
for _ in range(2):
token = profiler.start("in foo")
sleep(random())
profiler.stop(token)
@profiler.track("bar")
def bar():
for _ in range(3):
sleep(0.3 + random() * 0.001)
def zoo():
for _ in range(4):
token = profiler.start("in zoo")
sleep(random() * 3)
profiler.stop(token)
bar()
zoo()
foo()
foo()
profiler.printstats()
profiler.clear()
total=0:00:01.866119 avg=0:00:00.466529±0:00:00.340207 runs=4 in foo
total=0:00:01.579377 avg=0:00:00.394844±0:00:00.310193 runs=4 in zoo
total=0:00:00.902268 avg=0:00:00.902268±0:00:00 runs=1 bar
total=0:00:00.867672 avg=0:00:00.433836±0:00:00.332681 runs=2 foo
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
handprofiler-0.0.3.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file handprofiler-0.0.3.tar.gz
.
File metadata
- Download URL: handprofiler-0.0.3.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcb90b1e5c9390a13d91028360449f56aa3ef9e92c0ac594fc04ba5a226dca4e |
|
MD5 | e4e0e485c052ddf043a661b800f0ce17 |
|
BLAKE2b-256 | 9d24de1d821c52dfd170393d43f5a59eb7b590afdd4e4879c0da87e1a06f437b |
File details
Details for the file handprofiler-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: handprofiler-0.0.3-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 184d01df22222fcffd01876475ea0f8af6eb29a1263b7638bfda845d18df455a |
|
MD5 | 2784aedbf23e7d40272260bc27907865 |
|
BLAKE2b-256 | f01261d1e58a4d00b14bca7fd2470371a2a8aeebd3eb301c5830bed4f181f645 |