Note, this answer here which works as expected.
I had like to execute a function every X seconds and increment by 2 seconds on every successive run.
So for an example, the first time the function should run at 3 seconds, then it should run at 5, then it should run at 7 seconds and so on...
First run - 3 seconds
Second run - 5 seconds
Third run - 7 seconds
and so on...
My code is
from twisted.internet import task, reactor
timeout = 3 # three seconds
def doWork():
#do work here
pass
l = task.LoopingCall(doWork)
l.start(timeout) # call every three seconds
reactor.run()