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 (BSD licensed) context manager for timing execution.

Project Description

A (BSD licensed) context manager for timing execution. Useful for benchmarking everyday Python code easily/cleanly.


Usage is trivial. Simply wrap your code in a Timer context manager. Example:

from chrono import Timer

with Timer() as timed:
    # Put whatever logic you want here.
    # ``for`` loops are great here for timing things that are very fast.

print("Time spent: {0} seconds".format(timed.elapsed))


  • Python 2.6+ or Python 3.3+ (may work on Python 2.5)




This is implemented in pure Python, so it doesn’t have the accuracy a C extension would have. There’s also overhead for the context manager function calls, so don’t use this to bench C code.

That said, for most everyday usage of Python, it’s very helpful.

Running Tests


$ git clone
$ cd chrono
$ virtualenv -p python3 env3
$ . env3/bin/activate
$ pip install nose


$ nosetests -s -v

chrono is maintained with 100% passing tests at all times.


  • Added links to the docs
  • Added initial docs
  • Fixed up the main docstring in Timer
  • Initial release
Release History

Release History

This version
History Node


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
chrono-1.0.2-py2.py3-none-any.whl (4.1 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Dec 3, 2013
chrono-1.0.2.tar.gz (3.1 kB) Copy SHA256 Checksum SHA256 Source Dec 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