Hi.
I'm not sure which way to do this: I would like to call a function simulate() repeatedly and the function, after having done some calculations, calls update() and draws on the screen.
There seems to be two ways, either having a timer that timesout and then calls simulate(), or to have the function call it self after doing the update.

I would like to have a start/stop button for the simulation. With the timer, that is just to make a button click tell the timer to stop, but with the recursive call, I think I have then to set a bool variable that tells simulate() to stop.

Or perhaps a third way, not ,making it recursive, but instead emit a signal that connects to the simulate() slot?
The question is: if you understand what I want, which way is the better?