|
1
108
如果要对整个函数计时,则可以使用
Run the example on the playground . specification says this about deferred calls :
函数值
使用 runtime.Callers runtime.CallersFrames 自动获取调用函数的名称。
|
|
|
2
22
Bayta Darell 是完美的。 此外,如果不想显式传递函数名,可以这样完成:
有关更多信息,请参阅本文: Go Function Tracing 分享知识。:) |
|
|
3
4
|
|
|
4
2
您可以轻松获得 执行时间 在控制台上使用延迟功能
或者你可以使用这个代码
签入代码 Playground |