Relative Content

Tag Archive for multithreadingdatetimetimetimestamp

Repeat python function with precise time stamp

I have a task to communicate with a hardware with reasonably high precision (1pps) to simulate telemetry data collection. Based on StackOverflow and other sources I was able to come up with the following code.
The code works good enough, however it has a runoff with about 1 msec. I.E., the beginning every execution is late by about 1 millisecond. If left running overnight, the runoff increases to several dozen millisec. The real hardware host has a GPS source for 1pps, but I need to test my hardware with simulation from the PC.
The printout chart is the best way to understand the problem.
The plotting is optional, but it shows the problem visually.