Skip to main content

A simple stopwatch for measuring code performance

Project description

Stopwatch

A simple stopwatch for measuring code performance.

Installing

To install the library, you can just run the following command:

$ python3 -m pip install chronowatch

Examples

from chronowatch import Stopwatch

stopwatch = Stopwatch('Building it')
stopwatch.start("Preparing files")
time.sleep(3.0)
stopwatch.stop()
print(stopwatch.last_task_info())
# TaskInfo(task_name='Preparing files', time_nanos=3009159300)

stopwatch.start("Processing files")
time.sleep(2.0)
stopwatch.stop()

print(stopwatch.pretty_print())
# StopWatch 'Building it': 5.013895300 seconds
# ---------------------------------------------
# Seconds         %         Task name
# ---------------------------------------------
# 3.009159300     60%       Preparing files
# 2.004736000     40%       Processing files

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

chronowatch-1.0.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

chronowatch-1.0.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file chronowatch-1.0.0.tar.gz.

File metadata

  • Download URL: chronowatch-1.0.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for chronowatch-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7edab422af1f4208bebc3f2e7193fa8051728759abd66cc34072976c9aca95f3
MD5 7476e2d0afe7d00c8bd13b1b28414f0b
BLAKE2b-256 adc07e32107009ba70095b6d3322b111a540bc66e3031e718ebc404431c33654

See more details on using hashes here.

File details

Details for the file chronowatch-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: chronowatch-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for chronowatch-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c773843bacc14989fccff204543df41e533f987ad9570993b6c1a2becdc664e8
MD5 a99fc0b02527db78cc1d2bfa849ebc74
BLAKE2b-256 1301d5985daf829aed5201ad6667d589e0b37167cce6006e9e6188883f90a300

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