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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 2

File details

Details for the file pystopwatch2-0.1.1.tar.gz.

File metadata

  • Download URL: pystopwatch2-0.1.1.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.7.15

File hashes

Hashes for pystopwatch2-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ff966a9efd986bada45b2c460c1b84cc658a62ffdb7cbf0e099df4094b3a1600
MD5 c482a67f25fa11d30c5e8a8b7f60e12e
BLAKE2b-256 1431e487eb7e1ba613d6ed88af00a0da147edc3243ba66f6e174979a60ad139d

See more details on using hashes here.

File details

Details for the file pystopwatch2-0.1.1-py2-none-any.whl.

File metadata

  • Download URL: pystopwatch2-0.1.1-py2-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.7.15

File hashes

Hashes for pystopwatch2-0.1.1-py2-none-any.whl
Algorithm Hash digest
SHA256 2b434da0b4657015fae5edf4e492504ec53019634f08d8b4f5706cd7c08879ab
MD5 3310c49eae9a47f0c96104fcce2b7fe4
BLAKE2b-256 4a0a96f24578bbfdb2d3c7d9433414713dd1c90396c20e704fae10c8a69e39c6

See more details on using hashes here.

Supported by

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