@LIUHUAN
2017-11-13T17:34:51.000000Z
字数 352
阅读 1396
Go
start := time.Now()
//some func or operation
cost := time.Since(start)
fmt.Printf("cost=[%s]",cost)
func compute() {
start := time.Now()
defer func() {
cost := time.Since(start)
fmt.Println("cost=", cost)
}()
// some computation
}