somakeit / door-controller2

A new door controller for a new space, where all the previous hardware is broken and we can't replace it.
1 stars 0 forks source link

Solve issues with time/clock skew #2

Closed benjie closed 9 years ago

benjie commented 9 years ago

Much of the script uses time.time() to determine the absolute time, however ntpd and various other things can mess with this giving inaccurate timings. Suggest switching to os.times()'s 5th entry

os.times() Return a 5-tuple of floating point numbers indicating accumulated (processor or other) times, in seconds. The items are: user time, system time, children’s user time, children’s system time, and elapsed real time since a fixed point in the past, in that order. See the Unix manual page times(2)

brackendawson commented 9 years ago

Better to be good than rely on ntpd slew.