I need to be able to run a certain loop every single minute on the minute of the clock. So basically, not just every 60 seconds, but whenever the clock changes to 1 minute further (e.g 15:00 to 15:01).
What would you be able to achieve this in python, and would this be accurate?
I currently have this to run every minute, but this doesn't run every minute on the clock:
td = 1
sleep = td - datetime.now().minute % td
if sleep != td:
time.sleep(sleep * 60)
else:
# code
Thank you in advance.