joan2937 / pigpio

pigpio is a C library for the Raspberry which allows control of the General Purpose Input Outputs (GPIO).
The Unlicense
1.45k stars 407 forks source link

gpioSetTimerFunc[Ex] time includes the time for the callback #565

Open tomdean1939 opened 1 year ago

tomdean1939 commented 1 year ago

The doc says call the callback every millisec. However, the time from the start of one callback to the start of the next varies by the time spent in the callback. With a logic analyzer, with a 50 msec callback, I observed 4msec in callback, 54 msec call interval, 19 msec in callback, 69 msec call interval.

The method in pthTimerTick() may be hard to change. (I use timerfd in other applications).

Maybe the best solution is to change the doc.