1. 统计模块耗时
start := time.Now() // 代码块 e.timeCost = time.Since(start).Seconds() cost := fmt.Sprintf("%.3f", e.timeCost)
2. 时间格式化
Go常用时间类工具
原文:https://www.cnblogs.com/zk-blog/p/14901942.html