mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 13:18:01 +08:00
21 lines
255 B
Go
21 lines
255 B
Go
package main
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/gogf/gf/os/gcron"
|
|
"github.com/gogf/gf/os/glog"
|
|
)
|
|
|
|
func test() {
|
|
glog.Println(111)
|
|
}
|
|
|
|
func main() {
|
|
_, err := gcron.AddOnce("@every 2s", test)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
time.Sleep(10 * time.Second)
|
|
}
|