Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A timer module. Makes it easy to track elapsed time.

Project Description

A timer module. Makes it easy to track elapsed time.


Latest stable version on PyPI:

$ pip install simple_timer

Latest stable version on bitbucket:

$ pip install -e hg+

Usage example

Required imports.

>>> from simple_timer import Timer

Initialise timer.

>>> timer = Timer()

Print elapsed duration.

>>> print timer.duration

Print elapsed timedelta.

>>> print timer.timedelta
datetime.timedelta(0, 0, 7)

Stop the timer. Stopping the timer makes the duration and timedelta properties to freeze.

>>> timer.stop()

Print frozen timedelta value.

>>> print timer.timedelta
datetime.timedelta(0, 2, 943660)

Print frozen duration value.

>>> print timer.duration

Once stoped, when calling the stop method again unfreezes the timer, calculates the new values and freezes the timer again.

Shortcut for stopping and returning the duration value.

>>> timer.stop_and_return_duration()

Shortcut for stopping and returning the timedelta value.

>>> timer.stop_and_return_timedelta()
datetime.timedelta(0, 170, 351115)


GPL 2.0/LGPL 2.1


Artur Barseghyan <>

Release History

Release History

This version
History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
simple_timer-0.2.tar.gz (3.0 kB) Copy SHA256 Checksum SHA256 Source Oct 3, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting