Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Python module to access the monotonic clock on POSIX-like OSes that have `librt`.

License

tomstokes/Monoclock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Monoclock is a Python module that provides access to the monotonic clock on POSIX-like OSes that have librt.

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

Install: python setup.py install

Run the tests: python run_tests.py

Usage

import monoclock
t = monoclock.nano_count()
print t

If you want seconds, divide t by 1e9.

Misc

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

Wishlist

  • 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/time_win.cc just disables use of the monotonic clock on Athlon X2 CPUs with if (cpu.vendor_name() == "AuthenticAMD" && cpu.family() == 15

Contributing

Patches and pull requests are welcome.

This coding standard applies: http://ludios.org/coding-standard/

About

Python module to access the monotonic clock on POSIX-like OSes that have `librt`.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 67.1%
  • C 32.9%