测试定时器

This commit is contained in:
ZJY 2021-09-07 01:14:26 +08:00
parent 63ad073eb8
commit fbd3cf2830

View File

@ -11,7 +11,7 @@ func intiSky(f func()) {
f()
now := time.Now()
// 计算下一个零点
next := now.Add(time.Hour * 12)
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(now))
<-t.C