Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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.

Files for pystopwatch2, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size pystopwatch2-0.1.1-py2-none-any.whl (6.9 kB) File type Wheel Python version py2 Upload date Hashes View hashes
Filename, size pystopwatch2-0.1.1.tar.gz (2.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page