Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

The simplest ever library for measuring time of python code execution.

Project Description

The simplest ever library for measuring time of python code execution.

Installation

pip install timepy

How to use

from timepy import Timer

It’s simple:

t = Timer()

t.start()
# Your code which you want to measure
t.stop()
print(t.total_time)

You can give a name fro your timer:

t = Timer('My second timer')

Keep every moment you want

You can

t = Timer()
t.start()
# Some heavy work 1
t.commit('Work 1 is done')
# Some heave work 2
t.commit('Work 2 is done')
t.stop()

print(t.events)

# will output:
# [<TimerStarted: 0.0 s>,
#  <TimerCommitted: 10.0 s (Work 1 is done)>,
#  <TimerCommitted: 20.0 s (Work 2 is done)>,
#  <TimerStopped: 20.001 s>]

Measure your iterations

t = Timer()
t.start
for i in some_list:
    # do heavy work
    t.lap()
t.stop()

print(t.laps[0])      # <Lap 0: 123 s>
print(t.laps)         # see all laps
print(t.average_lap)  # average lap duration

Release History

This version
History Node

0.1.8

History Node

0.1.7

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1

History Node

0.1a

Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
timepy-0.1.8.tar.gz
(3.4 kB) Copy SHA256 Hash SHA256
Source None Mar 21, 2017

Supported By

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 Google Google Cloud Servers DreamHost DreamHost Log Hosting