t := time.Now()
elapsed := time.Since(t)
fmt.Println("app1 elapsed:", elapsed)
//执行某些代码
fmt.Println("app1 elapsed:", elapsed)
t := time.Now()
elapsed := time.Since(t)
fmt.Println("app1 elapsed:", elapsed)
//执行某些代码
fmt.Println("app1 elapsed:", elapsed)
本文标题:golang检测func的执行时间
本文链接:https://www.haomeiwen.com/subject/dvmsictx.html
网友评论