Go常用时间类工具

1.  统计模块耗时

start := time.Now()
// 代码块
e.timeCost = time.Since(start).Seconds()
cost := fmt.Sprintf("%.3f", e.timeCost)

2. 时间格式化

 

posted @ 2021-06-19 06:26  骑着蜗牛看海呀  阅读(143)  评论(0编辑  收藏  举报