Day 098 - 100 Days of Code - Automate Automate!

Question on the use of time.sleep to reduce CPU usage: Let’s say I want the program to email me every 30 minutes. What’s the proper way to set up time.sleep() in this case?

More specifically:

  • Do I need to set the argument within time.sleep() as a divisor of the every() argument? So lets say every 15 minutes (900 seconds) or exactly every 30 minutes (1800 seconds)?
  • Or can I set the time.sleep to eg 29 minutes (1740 seconds).
  • Or does setting time.sleep() at 29 minutes make the while True “miss” the scheduled email send?

Hopefully this questions makes sense…

1 Like

4 posts were merged into an existing topic: Day 098 - Project 98 : Automate! Automate!