skip to navigation
skip to content

Monoclock 14.4.18

Monotonic clock access for Python


Monoclock is a fast Python module that provides access to the monotonic clock on Linux and OS X.

Compatibility: tested on CPython 2.6.5, CPython 2.7, pypy 1.3, and pypy 1.4.


` import monoclock t = monoclock.nano_count() print t `

If you want seconds, divide t by 1e9.


Make sure you have a C compiler and Python headers installed. On Ubuntu, that can be done with

` sudo apt-get install python-dev build-essential `

Then, install Monoclock from PyPi:

` pip install --user Monoclock `

or from the git repo:

` git clone cd Monoclock pip install --user . `

or without pip:

` python install --user `

You should now have the monoclock module installed.

Optionally, run the tests with python


If you’re having trouble with monotonic clocks, see:


  • Windows support.

  • Solaris support (does it work?).

  • Expose CLOCK_MONOTONIC_RAW (which is not adjusted by NTP).

  • Support buggy AMD chips, or expose a probablyBuggy() function that returns True if the monotonic clock is unreliable.

    Note: Chromium’s base/ just disables use of the monotonic clock on Athlon X2 CPUs with if (cpu.vendor_name() == “AuthenticAMD” && == 15


Patches and pull requests are welcome.

This coding standard applies:

File Type Py Version Uploaded on Size
Monoclock-14.4.18.tar.gz (md5) Source 2014-04-18 3KB (md5) Source 2014-04-18 4KB