增加立即执行的定时器示例
This commit is contained in:
parent
9c8b64eaf3
commit
6a05f8614c
@ -8,13 +8,7 @@ import (
|
|||||||
|
|
||||||
func TestTicker(t *testing.T) {
|
func TestTicker(t *testing.T) {
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
// 记录初始时间
|
var data, expected []int64
|
||||||
data := []int64{
|
|
||||||
now.Unix(),
|
|
||||||
}
|
|
||||||
expected := []int64{
|
|
||||||
now.Unix(),
|
|
||||||
}
|
|
||||||
|
|
||||||
// 预期每隔一秒收到一个信号
|
// 预期每隔一秒收到一个信号
|
||||||
for i := 0; i < 3; i++ {
|
for i := 0; i < 3; i++ {
|
||||||
|
Loading…
Reference in New Issue
Block a user