Open isayme opened 6 years ago
func getCurrentFuncName() string { pc := make([]uintptr, 1) runtime.Callers(2, pc) f := runtime.FuncForPC(pc[0]) return f.Name() }
详细见: https://github.com/isayme/blog/blob/master/issues/14/
执行make bench 查看 benchmark 数据
make bench
代码
还有另外一种写法, 但是效率低了很多
详细见: https://github.com/isayme/blog/blob/master/issues/14/
参考资料