Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flxxyz/crontab
golang封装极简定时器
https://github.com/flxxyz/crontab
crontab crontab-go go golang-library
Last synced: 4 days ago
JSON representation
golang封装极简定时器
- Host: GitHub
- URL: https://github.com/flxxyz/crontab
- Owner: flxxyz
- License: mit
- Created: 2019-06-21T07:25:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-25T08:16:33.000Z (over 5 years ago)
- Last Synced: 2024-06-20T12:45:54.559Z (5 months ago)
- Topics: crontab, crontab-go, go, golang-library
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# crontab
golang封装定时器## 依赖要求
没有## 安装
使用`go`命令获取类库```bash
go get github.com/flxxyz/crontab
```## 例子
```go
package mainimport (
"github.com/flxxyz/crontab"
"log"
"time"
)func init() {
//运行定时器,可随意放置代码位置
crontab.Init()
}func main() {
//创建一个单次定时器
crontab.NewTimer(time.Second*5, func() {
log.Println("这是一个单次定时器")
})//创建一个多次定时器
crontab.NewTicker(time.Second*1, func() {
log.Println("这是一个多次定时器")
})
}
```## 文档
[文档点这里](http://godoc.org/github.com/flxxyz/crontab)## 版权
crontab包在MIT License下发布。有关详细信息,请参阅LICENSE。