Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add profile.elapsed #1478

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

colinsusie
Copy link
Contributor

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

testprofile.lua是一个简单的例子

@cloudwu
Copy link
Owner

cloudwu commented Sep 23, 2021

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

@colinsusie
Copy link
Contributor Author

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

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

能否再评估一下。

@cloudwu cloudwu force-pushed the master branch 2 times, most recently from 31e0ac2 to 208be03 Compare December 10, 2021 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants