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

fix no necessary sleep time for mac main loop #1472

Merged
merged 1 commit into from Aug 23, 2018

Conversation

drelaptop
Copy link
Contributor

mac 平台主循环未考虑,帧执行时间小于期待帧间隔时间时,需要 sleep 一段时间。

http://forum.cocos.com/t/cocos-creator-2-0-1/64948

@drelaptop drelaptop requested a review from minggo August 23, 2018 08:16
}
else
{
usleep(_16ms);
std::this_thread::sleep_for(std::chrono::microseconds(desiredInterval));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用 C++ 标准库的 sleep,不用 C 风格的 usleep , desiredInterval 期待的间隔时间,更符合实际含义。

@drelaptop
Copy link
Contributor Author

please review and merge @minggo

@minggo minggo merged commit 66866a8 into cocos:v2.0-release Aug 23, 2018
@drelaptop drelaptop deleted the v2.0-fix-mac-main-loop branch August 27, 2018 10:25
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