I am trying to get Julia to execute a loop everyday at a given time, e.g. 18:00:00. I would just use the sleep function but the amount of time required to complete the function varies by day so this would cause the start time to slip on a daily basis. Instead I am trying something like the following.
while true
run function
w = Dates.Time(18,00,00)-Dates.Time(Dates.now())
wait = w.value/(1*10^9)
sleep(wait)
end
Just wondering if this was the right approach or if there was a more efficient way to go about it. Thanks!