On Fri, 2018-07-20 at 12:52 -0400, Andrew Stitcher wrote: > I've now looked at the actual code! > > Things are a bit more complicated than I remembered:
I forgot one semi-important difference between setupNextFireTime() and restart(). setupNextFireTime() is intended to be used for periodic tasks where the period matters, so it sets up the firings to be equally spaced in time: so it sets up the next fire time to be the previous_fire_time + period (*not* now + period). This will lead to the average period tending to the specified period irrespective of how long it takes to service the timer firing. However restart() just sets the next fire to now + period. So is not useful if you want to keep a fairly strict period. This is why you can use restart() after firing, you may just want another callback after the period not at the correct time for a periodic timer. So although at first glance they may do the same thing after the timer has fired, this is not actually the case. As I have stated a number of times now I believe that in the journal case only restart() should be used. Andrew --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
