Skip to content

ElectricRCAircraftGuy/eRCaGuy_PyTime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyTiming

Description:

Create some low-level Arduino-like millis() & delay() (for milliseconds) and micros() and delayMicroseconds() (for microseconds) timing functions for Python.

Compatible with Python in both Windows and Linux. Has ultra-great resolution timestamps (sub-microsecond), even in older versions of Python 3 which don't natively support (in the time module, for instance) high resolutions like this.

Author:

Gabriel Staples
www.ElectricRCAircraftGuy.com
-click "Contact me" at the top of my website to find my email address

Website:

http://www.electricrcaircraftguy.com/2016/07/arduino-like-millisecond-and-microsecond-timestamps-in-python.html

My other timing libraries and code:

  1. For anyone looking for a precision timing library on Linux in C or C++, see my library here. It is one of my best works yet, as of June 2022:
    1. timinglib.h
    2. timinglib.c
    3. Demos:
      1. timinglib_get_resolution.c
      2. timinglib_pthread_periodic_loop.c
      3. timinglib_sleep_and_sleep_until.c
      4. timinglib_timestamps_basic.c
      5. timinglib_timestamps_rapid.c
  2. My 3 sets of timestamp functions (cross-linked to each other):
    1. For C timestamps, see my answer here: Get a timestamp in C in microseconds?
    2. For C++ high-resolution timestamps, see my answer here: Here is how to get simple C-like millisecond, microsecond, and nanosecond timestamps in C++
    3. For Python high-resolution timestamps, see my answer here: How can I get millisecond and microsecond-resolution timestamps in Python?

History:

(newest on top)

  • 20160907 - v0.2.1 created - updated delay functions to use modulus operator to guarantee proper C uint32_t-like underflow subtraction behavior when the timer rolls over
  • 20160813 - v0.2.0 created - added Linux capability
  • 20160711 - v0.1.0 created - functions for Windows only (via the QPC timer)