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

Sleep between updates #10

Merged
merged 1 commit into from
Oct 3, 2020
Merged

Sleep between updates #10

merged 1 commit into from
Oct 3, 2020

Conversation

wezm
Copy link
Contributor

@wezm wezm commented Sep 29, 2020

This PR uses sleep to insert a delay into the main loop. This greatly reduces CPU usage. The delay is capped at 1 second so that key events are still processed in a timely fashion when the refresh rate is low.

@yxdunc
Copy link
Owner

yxdunc commented Oct 3, 2020

Great improvement, the capping logic is very nice!

@yxdunc yxdunc merged commit 92d0abc into yxdunc:master Oct 3, 2020
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