seporaitis / lhl

Linux Ham Log - an attempt to write modern terminal linux ham radio logging application from scratch
0 stars 0 forks source link

Stop unrestricted looping. #12

Closed seporaitis closed 5 years ago

seporaitis commented 5 years ago

Since getch is non-blocking it means that while no interaction is happening, the loop is nooping unconstrained - consuming 100% cpu. Add napms call when no input has been received, which makes the loop sleep for 25ms. This reduces cpu load to ~0-1% and is not impairing responsiveness.