How to run a repeating timer every n minutes?

  • Thread starter VYAS ASHISH M-NTB837
  • Start date
V

VYAS ASHISH M-NTB837

Dear All

How do I write a code that gets executed 'every x' minutes?



I know how to do it 'after x' minutes, I do the following:

def doAtTimerFire():
""" The things I want to do 'after x' minutes go here. """

And then from main code, I do this:

tmr = threading.Timer(timeInSeconds, doAtTimerFire)
tmr.start()


Sorry about the earlier post with wrong subject line.
Please help.

Regards,
Ashish Vyas
 
M

Martin P. Hellwig

VYAS ASHISH M-NTB837 wrote:
<cut>
You might want to start a thread with a continues loop that primarily
sleeps (time.sleep) but wakes up at regular intervals and executes what
needs to be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top