Documentation ¶
Overview ¶
Package times 时间相关.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Hour ¶
func Hour(yield func()) func() bool
Hour 整点运行,返回取消方法.
Example ¶
package main import ( "time" "github.com/xuender/kit/logs" "github.com/xuender/kit/times" ) func main() { logs.I.Println("start") cancel := times.Hour(func() { logs.I.Println("run") }) go func() { time.Sleep(time.Second) cancel() logs.I.Println("stop") }() logs.I.Println("sleep") time.Sleep(2 * time.Second) logs.I.Println("end") }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.