I need to run a function at a specific time of the day (e.g. 0010, 0610, 1210, 1810). My current approach uses a ticker for _ = range time.Tick(21600 * time.Second), and I manually run the program at one of these intervals (e.g. 1210). This is obviously not optimal.
What is the best solution for this? I thought about starting a ticker every 60 seconds, and then checking to see if the time corresponds to one of the intervals, but it does not look very elegant.
source
share