mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 21:28:22 +08:00
17 lines
289 B
Go
17 lines
289 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"gitee.com/johng/gf/g/os/gcron"
|
||
|
"gitee.com/johng/gf/g/os/glog"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
cron := gcron.New()
|
||
|
glog.Println("start")
|
||
|
cron.DelayAddOnce(1, "* * * * * *", func() {
|
||
|
glog.Println("run")
|
||
|
})
|
||
|
|
||
|
time.Sleep(10*time.Second)
|
||
|
}
|