Skip to main content

Multi-functional Stopwatch for Python

Project description

pystopwatch

Multi-functional Simple Stopwatch for Python.

  • Multiple Stopwatch by Tags
  • Manage elapsed times by tags
  • Example of use : profiling python codes(latency by functions, ...)

Install

$ pip install pystopwatch2

Usage

from pystopwatch2 import PyStopwatch

w = PyStopwatch()
w.start(tag='a')
time.sleep(1)
w.pause('a')
e = w.get_elapsed('a')
print(e)
# 1.0xxx

w.start(tag='b')
time.sleep(0.5)
w.pause('b')
print(w)

"""
a: state=ClockState.PAUSE elapsed=1.0027 prev_time=1548382910.66398311
b: state=ClockState.PAUSE elapsed=0.5051 prev_time=1548382911.66670585
"""

e.clear('a')
e.clear('b')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pystopwatch2-0.1.1.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

pystopwatch2-0.1.1-py2-none-any.whl (6.9 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page