Monoclock: Access the monotonic clock from Python

Python’s time.time() jumps around if the system time changes. The monotonic clock doesn’t, and climbs steadily upwards. Unfortunately, Python doesn’t give you easy access to the monotonic clock. A 50-line Python module may help you out, at least if you have a POSIX-like OS that has librt (I tested only Linux).

Get it at: https://github.com/ludios/Monoclock

Let me know if it works, or doesn’t. Please contribute, especially if you’ve implemented Windows or OS X support.

Leave a Reply