so there is no pre-made internal clock qobject.
so what is the "best" way to get a internal clock?
- for my use i need a clock that does not trigger early (that means precise timer)
- also does not go banans after a few days cause of major out of sync with reality/systemtime +- 100ms is hard limit as out of sync as a showstopper.
in big strokes:
- use a precise timer with timeout @ x ms and then grab the currentTime from systemclock to update my internal qdatetime that i use to trigger my signals. (this way its allways somewhat in sync with systemclock)
- use a use a precise timer with timeout @ x ms and increment my clock internally.
i guest the currenttime systemclock version is more "expensive" then internal incrementation of my object and then say once a night check if a diff is building up and then its out of a set range sync it back into range.
right now im more afraid of overdoing this simple task then not getting it to work...
os wise, its linux commandline applications that will be running 24/7 so the time drift is one of my concerns.
ive made a little test which prints current time to console, with precision timer it seems accurate @1-2ms. and does not drift.
so the question is:
- internal counters + check sync @ interval(daily weekly etc) + sync up when out set boundary syncwise
- copy systemtime everytime timer triggers (seems like a more expensive copy to me but makes sync check and sync up obsolete. also makes alot of parsing out changes and triggers alot more work)
what path would you choose?
Bookmarks