golang函数调用计时

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()
}

  

上一篇:阿里云CentOS7.2服务器的安装


下一篇:iis 下的 selfssl