-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 Quick
mode for gtimer
#2488
Conversation
…sed to set the timer to quickly run without waiting for the first interval to be elapsed. This can be useful in certain scenarios where time-sensitive operations need to be performed immediately.
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## master #2488 +/- ##
==========================================
+ Coverage 79.96% 80.18% +0.21%
==========================================
Files 598 597 -1
Lines 49570 49688 +118
==========================================
+ Hits 39641 39841 +200
+ Misses 7984 7911 -73
+ Partials 1945 1936 -9
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@hinego I've thought about it. Is it better to call your timer function and then add it to timer? |
I see what you mean, but its need extra coding like this
However, by my method,only need set the Like this
so... |
@hinego Please add associated unit testing case for your updates. |
今天用到gtimer.once 时发现一个问题,如果quic时once这种就不适合了 所以要么,再适配一下,把once时不受quick的影响,要么once时不要使用quick模式 |
When I used gtimer.once today, I found a problem. Once is not suitable for quic So either, adapt it again, and make once unaffected by quick, or don’t use quick mode when once |
I think it needs no worry about once. |
This commit adds a new
Quick
bool to the timer code, which can be used to set the timer to quickly run without waiting for the first interval to be elapsed. This can be useful in certain scenarios where time-sensitive operations need to be performed immediately.此提交向 gtimer 添加了一个新的“Quick”布尔值,可用于将计时器设置为添加任务后立即执行,而无需等待第一个间隔结束。 这在某些需要立即执行时间敏感操作的场景中很有用。
PS:现在假设我添加一个30分钟执行的任务,则需要30分钟后才能第一次执行!