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

Reactivation of time.sleep for CPU idle #72

Merged
merged 2 commits into from
Jul 4, 2022

Conversation

AxelHamburch
Copy link
Contributor

200 ms delay for CPU idle and other processes

Too long a delay will have a negative effect on the coin detection and the lockout relay

 # 200 ms delay for CPU idle and other processes
 # Too long a delay will have a negative effect on the coin detection and the lockout relay
Set CPU sleep time to 0,1 second. CPU workload then is 15%, thats fine. 0,2 s would be 10% and 0,01 would be 25-30%. Nothing would be 100%.
@AxelHamburch
Copy link
Contributor Author

@lightisfaster
I just tested the CPU workload again with the command "htop".
0.1 second sleep time ist fine.

Zero was bullshit and results in 100% cpu workload:

2022-06-26 13_28_49-Posteingang – Gmx ‎- Mail

Was my fault.

0.01 seconds would result in 20-30%:

2022-06-26 13_31_36-Posteingang – Gmx ‎- Mail

0.1 results in 15% CPU workload, 0.2 seconds would result in 10%. I think 0.1 is a good compromise:

2022-06-26 13_33_58-Posteingang – Gmx ‎- Mail

Copy link
Collaborator

@lightisfaster lightisfaster left a comment

Choose a reason for hiding this comment

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

I need to test this because i've already do this change (see history). I'm changing it back because of a runtime issue.

# time.sleep(0.5)

# 200 ms sleep for CPU idle and other processes
time.sleep(0.1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I need to test this because i've already do this change (see history). I'm changing it back because of a runtime issue.

@lightisfaster lightisfaster merged commit 1764c16 into 21isenough:master Jul 4, 2022
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.

2 participants