robfig/cron 支持cron 和 固定时间
最后更新于:2022-04-02 02:40:08
[TOC]
> [github](https://github.com/robfig/cron)
## 安装
```
go get github.com/robfig/cron/v3@v3.0.0
```
## 实例
### 按时间间隔
### 按 cron
';
main.go
``` package main import ( "fmt" "sync" "time" "github.com/roylee0704/gron" ) func main() { var wg sync.WaitGroup wg.Add(1) c := gron.New() c.AddFunc(gron.Every(5*time.Second), func() { fmt.Println("runs every 5 seconds.") }) c.Start() wg.Wait() } ```### 按 cron