startTimer()'s first call


#1

Hi Jules

Would you consider adding something like startTimer(int intervalInMilliseconds, bool shouldStartNow = false) ?

I’m using the Timer from a thread and I need the 1st iteration to happen right away,
And since It needs to be called by the Message Thread, I need to use AsynchUpdater or MessageManager::callFunctionOnMessageThread
or CallbackMessage in addition to the startTimer().

Thanks


#2

Whenever I’ve needed to do that, I tend to just call startTimer(1) initially, and then in my timer callback, I call startTimer (whatever) to give it the real frequency.


#3

What about :

startTimer(ms);
  callFunctionOnMessageThread(MyClass::timerCallback);
or
  timerCallback();

#4

10x

I’ve used the startTimer(1) approach though it makes unnecessary calls to startTimer().