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.
Since
getch
is non-blocking it means that while no interaction is happening, the loop is nooping unconstrained - consuming 100% cpu. Addnapms
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.