package main
import (
"github.com/robfig/cron/v3"
"log"
)
func main() {
c := cron.New()
_, _ = c.AddFunc("@every 5s", timer)
c.Start()
select {}
}
func timer() {
log.Println("每5s执行一次")
}
Golang实现定时任务
最新推荐文章于 2024-10-08 17:41:05 发布