crontab

package
v0.0.0-...-ac7d4c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 5 Imported by: 0

README

定时任务

这是一个超级简单的定时任务工具,100万个任务时效果良好

快速上手

NewCron("* * * 14 * /10", func() {
     
})

使用说明

表达式

  • 1、表达式一共有6位,分别表示【月、日、周、时、分、秒】
  • 2、数字参数表示指定时间执行
  • 3、指令*表示接收任意时刻
  • 4、指令/表示间隔执行
* 1 * 20 0 0         每月1号20点0分0秒执行
* * * * * /5        每隔5秒执行一次
* * * 14 * /10      14点的时候每隔10秒执行一次

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCron

func NewCron(specs string, job func()) error

spec=月 日 周 小时 分 秒 * 不限制 / 间隔

  • 1 * 20 0 0 每月1号20点0分0秒
  • * * * * /5 每隔5秒执行一次

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL