Suppose I'm running a program and each day I want to pause the program after X iterations until the start of the next calendar day. The amount of time the program will have to be paused each day will vary because I do not know when X iterations will be completed on a given day.
Question Is there a simple way to pause the program so that it will restart at the start of the next day E.S.T?
I thought of using the sleep() function. The problem is the interval the program would have to pause each day is different so I can't put in an absolute time value. So I thought conceptually it would something like this might work.
while true
# run function until X loops
# sleep(Minute(tomorrow's date - now())
But I'm not sure how I would get the start of tomorrow's date from Julia or if this is the most efficient approach.
Any thoughts would be greatly appreciated. Thanks!