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(),next.Location()) t := time.NewTimer(next.Sub(<span style="font-family: Arial,Helvetica,sans-serif;">time.Now()</span><span style="font-family: Arial,sans-serif;">))</span> <-t.C } }() }原文链接:https://www.f2er.com/go/189729.html