Start and stop a python profiler
Project description
startstop
A simple way to start and stop a Python profiler (pyinstument) and view the results in the browser.
Installation
pip install startstop
Usage
from startstop import t, tc, p, pc
Simple timer
t()
# This is where your code goes.
t()
TIMER: 0.024 sec
t(label="your label", precision=2)
# This is where your code goes.
t()
TIMER your label: 0.02 sec
Simple timer as contex manager
with tc():
# This is where your code goes.
TIMER: 0.024 sec
with tc(label="your label", precision=2):
# This is where your code goes.
TIMER your label: 0.02 sec
Profiler
p()
# This is where your code goes.
p()
--> Browser output
p(interval=0.01, async_mode="disabled")
# This is where your code goes.
p()
--> Browser output
Profiler as context manager
with pc():
# This is where your code goes.
--> Browser output
with pc(interval=0.002, async_mode="strict"):
# This is where your code goes.
--> Browser output
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
startstop-1.0.8.tar.gz
(3.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file startstop-1.0.8.tar.gz.
File metadata
- Download URL: startstop-1.0.8.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b6c3e131befd38afa52bcee0b2554cd2a9d10003818e5fe79737211360e5dc1
|
|
| MD5 |
24316623a09bd9d3038a5e4f02998794
|
|
| BLAKE2b-256 |
116ee1f545e77224f7ee20043a05a848f2e415f6fd5c3fb9dcf029f940177c3d
|
File details
Details for the file startstop-1.0.8-py3-none-any.whl.
File metadata
- Download URL: startstop-1.0.8-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b06b263326f1e9cf5d53623964385ed91ccc42bdf9bac49337e387e138af6af
|
|
| MD5 |
05f691c17fab4359a7fd26155fc3e325
|
|
| BLAKE2b-256 |
c67d09ee564453a3b4ae929da14194c337579f953ddd22f711963337996014c4
|