测试定时器
This commit is contained in:
parent
63ad073eb8
commit
fbd3cf2830
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user