Both are really doing the same thing. The event option seem to add a unneeded layer of complexity. There is not significant difference in resource consumption.

A more appropriate option would be to use a timer.timer or threading.timer. This makes the code easier to read and understand since it expresses intent. Behind the scene all of the alternatives result in more or less the same thing.

You will need to consider how you count the time. Should the execution time be included in the timing interval or not? Often the interval is much longer than the execution time, so it does not matter. If it does matter you might need to set the timer to only trigger once, and reset the timer once your operation has completed.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top