目录
time.NewTimer
go func() {
t := time.NewTimer(time.Second * 3)
for {
select {
case <-t.C:
fmt.Println("123")
t.Reset(time.Second * 3)
}
}
}()
time.NewTicker
go func() {
t := time.NewTicker(time.Second * 3)
for {
select {
case <-t.C:
fmt.Println("123")
}
}
}()