Skip to main content

A simple stopwatch for python

Project description
A simple stopwatch for python, small, efficient and no dependencies


.. code:: sh
pip install

.. code:: py
from stopwatch import Stopwatch

stopwatch = Stopwatch() # Stopwatch keeps running
# but really its just math with time.perf_counter() so there isn't really a task
# running in background

stopwatch.stop() # stop stopwatch, time freezes
stopwatch.start() # Start it again
stopwatch.reset() # reset it back to 0
stopwatch.restart() # reset and start again
stopwatch.running # wether stopwatch is running
stopwatch.duration # Get the duration
str(stopwatch) # Get the friendly duration string

Python2 Support?
No sorry, This module depends on ``time.perf_counter()`` which doesn't exist on Python2 it should be compatible with any python3+ versions, maybe even other python implementations if it implements ``time.perf_counter()``


Originally written by `dirigeants <>`_ in `this file <>`_ i just looked at it and rewrote it in python, and it felt useful to put it in a module.

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, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size (3.3 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 DigiCert DigiCert EV certificate StatusPage StatusPage Status page