@LIUHUAN
2017-11-13T09:34:51.000000Z
字数 352
阅读 1610
Go
start := time.Now()//some func or operationcost := 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}
