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 } }() }
有疑问加站长微信联系(非本文作者)