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

经度不准,倒计时越来越慢 #2

Open
luo-h opened this issue Jan 6, 2021 · 13 comments
Open

经度不准,倒计时越来越慢 #2

luo-h opened this issue Jan 6, 2021 · 13 comments

Comments

@luo-h
Copy link

luo-h commented Jan 6, 2021

你可以设置个5分钟的倒计时试试,时间会越来越慢,倒计时两分钟后你这个可能还有3分30秒的样子

@LoSenTrad
Copy link
Owner

@luo-h 我排查一下

@LoSenTrad
Copy link
Owner

@luo-h 你在列表使用倒计时吗?

@LoSenTrad
Copy link
Owner

@luo-h 我测试了5分钟 没出现问题呀

@luo-h
Copy link
Author

luo-h commented Jan 6, 2021

不是列表,就是VC里面,用add和addMinuteTimer都有这个情况,我看简书评论里面也有一个人出现了这个情况啊。你可以开一个网页的倒计时作参照对比

@LoSenTrad
Copy link
Owner

@luo-h 你把你的代码复制一份给我 我来测试一下

@luo-h
Copy link
Author

luo-h commented Jan 6, 2021

LSTTimer.addMinuteTimer(forTime: TimeInterval(700),
identifier: "lkillTimer") {[weak self] (_, h, m, s, _) in
if h == "00" && m == "00" && s == "00" {
return
}
self?.setAppointmentAtrributeStr(timeStr: "((h):(m):(s))")
}

@luo-h
Copy link
Author

luo-h commented Jan 8, 2021

老哥,怎么样

@LoSenTrad
Copy link
Owner

@luo-h 加我一下微信 我这边好排查

@sizhugongzi
Copy link

你好,请问一下,NSTimer被添加在mainRunLoop中,mainRunLoop负责所有主线程事件,例如UI界面的操作,复杂的运算,这样就会造成timer的阻塞,NSTimer不准确,可以考虑GCD的定时器dispatch_time_t吗?

@sizhugongzi
Copy link

还有一个问题LSTPopView这个框架写的很好,嵌入一个倒计时会不会有点臃肿呀.

@sizhugongzi
Copy link

Simulator Screen Shot - iPhone 11 - 2021-09-08 at 18 04 36

@LoSenTrad
Copy link
Owner

你好,请问一下,NSTimer被添加在mainRunLoop中,mainRunLoop负责所有主线程事件,例如UI界面的操作,复杂的运算,这样就会造成timer的阻塞,NSTimer不准确,可以考虑GCD的定时器dispatch_time_t吗?

有时间的话 可以优化的 谢谢

@LoSenTrad
Copy link
Owner

还有一个问题LSTPopView这个框架写的很好,嵌入一个倒计时会不会有点臃肿呀.

有强迫症的 可能感觉会吧 有时间的话尽量除去所有依赖库 保证纯净不依赖

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

3 participants