Skip to main content

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

Project description

Description

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

License

GPL 2.0/LGPL 2.1

Installation

  • Latest stable version on PyPI:

    $ pip install simple_timer

  • Latest development version:

    $ pip install -e hg+http://bitbucket.org/barseghyanartur/timer#egg=simple_timer

Usage example

>>> from simple_timer import Timer
>>> my_timer = Timer()
>>> my_timer.stop()
>>> print my_timer.timedelta
datetime.timedelta(0, 4, 56711)
>>> print my_timer.duration
4.56711
>>> my_timer.stop_and_return_timedelta()
datetime.timedelta(0, 52, 367428)
>>> print my_timer.duration
52.367428
>>> my_timer.stop_and_return_timedelta()
datetime.timedelta(0, 167, 392662)
>>> my_timer.stop_and_return_duration()
183.344704

Author

Artur Barseghyan <artur.barseghyan@gmail.com>

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

simple_timer-0.1.tar.gz (2.2 kB view hashes)

Uploaded Source

Supported by

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