package cron
import "time"
func StartTimer(F func()) {
go func() {
for {
F()
next := now.Add(time.Hour * 24)
next = time.Date(next.Year(), next.Month(), next.Day(), 0, 0, 0, 0, next.Location())
t := time.NewTimer(next.Sub(<span style="font-family: Arial, Helvetica, sans-serif;">time.Now()</span><span style="font-family: Arial, Helvetica, sans-serif;">))</span>
<-t.C
}
}()
}
golang设置每天12点定时任务
最新推荐文章于 2024-07-25 20:20:12 发布