1 Star 4 Fork 0

magicianlyx / GoTask

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
timer.go 296 Bytes
一键复制 编辑 原始数据 按行查看 历史
magicianlyx 提交于 2021-11-20 21:16 . -
package GoTask
import "time"
type TimerObj func() (spec time.Duration, start, end time.Time)
// 计时器
func Timer() TimerObj {
p1 := time.Now()
return func() (spec time.Duration, start, end time.Time) {
p2 := time.Now()
spec = time.Now().Sub(p1)
start = p1
end = p2
return
}
}
Go
1
https://gitee.com/magicianlyx/GoTask.git
git@gitee.com:magicianlyx/GoTask.git
magicianlyx
GoTask
GoTask
v1.0.15

搜索帮助

53164aa7 5694891 3bd8fe86 5694891