项目地址:
https://github.com/robfig/cron
用法:
package main import ( "fmt" "github.com/robfig/cron/v3" ) func main() { ch := make(chan int) c := cron.New(cron.WithSeconds()) c.AddFunc("* * * * * *", func() { fmt.Println("one") }) c.AddFunc("* * * * * *", func() { fmt.Println("two") }) c.AddFunc("* * * * * *", func() { fmt.Println("three") }) c.Start() <- ch }
文档更新时间: 2024-04-20 10:57 作者:lee