21isenough / LightningATM

This ATM sends bitcoin over the Lightning Network - pretty fun.
MIT License
328 stars 86 forks source link

Reactivation of time.sleep for CPU idle #72

Closed AxelHamburch closed 2 years ago

AxelHamburch commented 2 years ago

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

AxelHamburch commented 2 years ago

@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