File size: 193 Bytes
7107f0b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package cron

import (
	"testing"
	"time"
)

func TestCron(t *testing.T) {
	c := NewCron(time.Second)
	c.Do(func() {
		t.Logf("cron log")
	})
	time.Sleep(time.Second * 3)
	c.Stop()
	c.Stop()
}