would you recommend using the import outside of the function or within is fine?
Any recommendations/critics welcome. Thanks
import time
import datetime
# Time Since
def time_since(since):
now = datetime.now()
unixtime = calendar.timegm(now.utctimetuple())
since = unixtime - 60 * 60 * 24 * 20
# Execute code every 60 sec
def autorun(seconds):
import time
starttime = time.time()
while True:
print("tick")
time.sleep(seconds - ((time.time() - starttime) % seconds))