gf/.example/os/gcron/gcron-log.go

17 lines
238 B
Go
Raw Normal View History

2019-04-09 00:15:48 +08:00
package main
import (
"time"
2019-07-29 21:01:19 +08:00
"github.com/gogf/gf/os/gcron"
"github.com/gogf/gf/os/glog"
2019-04-09 00:15:48 +08:00
)
func main() {
gcron.SetLogLevel(glog.LEVEL_ALL)
gcron.Add("* * * * * ?", func() {
glog.Println("test")
})
time.Sleep(3 * time.Second)
}