nezha/cmd/playground/main.go

26 lines
357 B
Go
Raw Normal View History

2019-12-02 09:57:14 -05:00
package main
import (
"log"
"github.com/robfig/cron/v3"
)
2019-12-02 09:57:14 -05:00
func main() {
c := cron.New(cron.WithSeconds())
_, err := c.AddFunc("* * * * * *", func() {
log.Println("bingo second")
})
if err != nil {
panic(err)
}
_, err = c.AddFunc("* * * * *", func() {
log.Println("bingo minute")
})
if err != nil {
panic(err)
}
c.Start()
select {}
2019-12-02 09:57:14 -05:00
}