标签:
package main import ( "log" "time" ) func f() { defer timeoutCheck("f slow", time.Now()) time.Sleep(time.Second) } func timeoutCheck(tag string, start time.Time) { dis := time.Since(start).Seconds() if dis > 1 { log.Println(tag, dis, "s") } } func main() { f() }
标签:
原文地址:http://www.cnblogs.com/moxiaopeng/p/4736951.html