jroimartin / gocui

Minimalist Go package aimed at creating Console User Interfaces.
BSD 3-Clause "New" or "Revised" License
9.92k stars 608 forks source link

Changed the main loop to save on processing speed #176

Closed Ximidar closed 6 years ago

Ximidar commented 6 years ago

I changed the main loop to consume events more efficiently. I was noticing that all my gocui apps were using 100% of the CPU and found the main loop to be the cause. I changed the flush command to be called at 60fps and then at that time is also when we check for termbox events. These changes caused my gocui apps to run more efficiently on the CPU. I hope this helps someone else as well.