示例#1
0
func main() {
	timingwheel := util.TimingWheel()
	timingwheel.Register(100, 0, func(_ int64) int64 {
		fmt.Printf("timeout\n")
		return 0
	})
	ticker := util.DurationTicker()
	ticker.Start(1, func(_ time.Time) {
		timingwheel.Tick(util.SystemMs())
	})
	for {
		time.Sleep(10000000)
	}
}
示例#2
0
func main() {
	var aa a
	aa = new(c)
	aa.funca()
	fmt.Printf("%ld\n", util.SystemMs())
}