From c9eb4e31af4d6b5cfebfc1d63746a4d4a6871e14 Mon Sep 17 00:00:00 2001 From: ouqiang Date: Sun, 14 May 2017 22:23:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test.go | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 test.go diff --git a/test.go b/test.go deleted file mode 100644 index 496cbe4..0000000 --- a/test.go +++ /dev/null @@ -1,37 +0,0 @@ -package main - -import ( - "github.com/ouqiang/timewheel" - "time" - "fmt" - "github.com/ouqiang/gocron/models" -) - -func main() { - // tick刻度为1秒, 3600个槽 - tw := timewheel.New(1 * time.Second, 3600) - tw.Start() - t := time.Now() - tw.Add(5 * time.Second, func() { - fmt.Println("5分钟", time.Now(), t.Add(5 * time.Second).Format(models.DefaultTimeFormat)) - }) - tw.Add(10 * time.Second, func() { - fmt.Println("10分钟", time.Now(), t.Add(10 * time.Second).Format(models.DefaultTimeFormat)) - }) - tw.Add(35 * time.Second, func() { - fmt.Println("35分钟", time.Now(), t.Add(35 * time.Second).Format(models.DefaultTimeFormat)) - }) - tw.Add(178 * time.Second, func() { - fmt.Println("178分钟", time.Now(), t.Add(178 * time.Second).Format(models.DefaultTimeFormat)) - }) - tw.Add(27 * time.Second, func() { - fmt.Println("27分钟", time.Now(), t.Add(27 * time.Second).Format(models.DefaultTimeFormat)) - }) - tw.Add(78 * time.Second, func() { - fmt.Println("78分钟", time.Now(), t.Add(78 * time.Second).Format(models.DefaultTimeFormat)) - }) - tw.Add(3 * time.Second, func() { - fmt.Println("3分钟", time.Now(), t.Add(3 * time.Second).Format(models.DefaultTimeFormat)) - }) - select {} -}