I fully redid the timing operation of my microcontroller. Now it wakes up every 1/10 second and records a time tick, and based on that I keep track of time hours/minutes/seconds since start, and also of elapsed time. I use elapsed time for preflow/postflow and such.
(wen I say wakes up, I must clarify that it does not sleep, it keeps running the main loop, but it interrupts itself with a timer interrupt evey 0.1 sec)
As always, the source code is released under GPL and is here