skynet icon indicating copy to clipboard operation
skynet copied to clipboard

add profile.elapsed

Open colinsusie opened this issue 3 years ago • 2 comments

我想增加一个profile.elapsed接口,用来作函数调用的时间统计,此接口对其他功能没有影响。

testprofile.lua是一个简单的例子

colinsusie avatar Sep 23 '21 13:09 colinsusie

建议用额外的库实现额外的功能。不建议再增加和修改 skynet 核心功能以外的代码。

cloudwu avatar Sep 23 '21 14:09 cloudwu

因为profile只有start和stop,这样只能统计一层函数,感觉加一个elapsed能取中间的时间值更完善一些,类似于C#的Stopwatch接口。

如果我直接用skynet.hpc()这样的函数,又没办法排除协程让出的时间。

能否再评估一下。

colinsusie avatar Sep 24 '21 02:09 colinsusie