Skip to content

1081/startstop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

startstop

A simple way to start and stop a Python profiler (pyinstument) and view the results in the browser.

PyPI - Version


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

About

start and stop a python profiler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages