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

暂停后resume时间不太对 #7

Open
caihuanjian opened this issue Jul 19, 2024 · 2 comments
Open

暂停后resume时间不太对 #7

caihuanjian opened this issue Jul 19, 2024 · 2 comments

Comments

@caihuanjian
Copy link

/**
* 暂停
*/
fun pause() {
if (state != IntervalStatus.STATE_ACTIVE) return
scope?.cancel()
state = IntervalStatus.STATE_PAUSE
delay = System.currentTimeMillis() - countTime
}

重新恢复时的delay时长应该轮询间隔减去已等待的时间,delay=period-(System.currentTimeMillis() - countTime)

@caihuanjian
Copy link
Author

这个库修复了,在网络库看到的

@liangjingkanji
Copy link
Owner

Net的代码没有修复吗?

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

No branches or pull requests

2 participants