This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Useful tools when dealing with clocks for timing and benchmarking. Will use a different method for retrieving accurate, monotonic clock values (see source for detail).

Tested on Python 2.7 and 3.3+. The latter is recommended because the time module contains much better access to OS timing functions.

Examples

Simple framerate-limiter:

>>> import ticking
>>> for frame, t in ticking.Clock(0.5):
...   print(frame, t)
...
1 0.5
2 1.0
3 1.5
...

After dropping a frame, the clock is aligned again:

>>> import time
>>> for frame, t in ticking.Clock(0.5):
...   print(frame, t)
...   time.sleep(0.8)  # drop a frame
...
1 0.5
3 1.5
5 2.5

Measuring time:

>>> with ticking.Stopwatch('Demonstration') as sw:
...   time.sleep(1.3)
...
>>> sw.total
1.3013252970049507
>>> print(sw)
Demonstration: took 1.30s

Quick in-program profiling:

>>> with ticking.profiled('testprofile.prof'):
...   time.sleep(1.0)
...
>>> import pstats
>>> pstats.Stats('testprofile.prof').print_stats()
Wed Jun  8 11:21:38 2016    testprofile.prof

         5 function calls in 1.001 seconds

   Random listing order was used

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        1    1.001    1.001    1.001    1.001 {built-in method sleep}
        1    0.000    0.000    0.000    0.000 /usr/lib/python3.4/contextlib.py:63(__exit__)
        1    0.000    0.000    0.000    0.000 {built-in method next}
        1    0.000    0.000    0.000    0.000 /home/marc/Documents/github.com/mbr/ticking/ticking.py:137(profiled)
Release History

Release History

0.4.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.1.dev1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
ticking-0.4.0.tar.gz (4.0 kB) Copy SHA256 Checksum SHA256 Source Jun 8, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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