golang 定时器封装——支持超时和函数自定义

如标题,封装一个golang的定时器,可以设置超时时间和定时器的interval。开启定时器后使用一个新的goroutine进行倒计时操做。git 好,下面上货。github package common import ( "context" "fmt" "github.com/google/uuid" "go.uber.org/atomic" "time" ) const ( S
相关文章
相关标签/搜索