Let's say that we have a main()
function that invokes a few functions that have been placed into different files.
What's the best practice ?
Option 1 : Have the while loop into the main function
def main():
interval = 60.0
start_time = time.time()
while True:
# calls to our functions
time.sleep(interval - (time.time()-start_time) % interval)
Option 2 : Having the main function called in the while loop
def main():
# calls to our functions
interval = 60.0
start_time = time.time()
while True:
main()
time.sleep(interval - (time.time()-start_time) % interval)
Does it actually change anything to use one method rather than the other one ?
Thanks for your advices !