文件名称:timer:High-performance timer implementation based on 5-level time wheel. 高性能定时器(5级时间轮)[从零实现]
文件大小:11KB
文件格式:ZIP
更新时间:2024-06-13 20:00:09
timewheel 5-level-time-wheel Go
timer timer是高性能定时器库 feature 支持一次性定时器 支持周期性定时器 一次性定时器 import ( "github.com/antlabs/timer" "log" ) func main() { tm := timer.NewTimer() tm.AfterFunc(1*time.Second, func() { log.Printf("after\n") }) tm.AfterFunc(10*time.Second, func() { log.Printf("after\n") }) tm.Run() } 周期性定时器 import ( "github.com/antlabs/ti
【文件预览】:
timer-master
----time_wheel_test.go(3KB)
----timer_test.go(2KB)
----.github()
--------workflows()
----LICENSE(1KB)
----time_wheel.go(5KB)
----time_wheel_node.go(2KB)
----.gitignore(308B)
----timer.go(436B)
----_long-time-test()
--------long-time-test.go(3KB)
--------build.sh(33B)
----go.sum(1KB)
----time_wheel_utils.go(146B)
----README.md(2KB)
----go.mod(162B)