Re: ncurses event loop
- From: Thomas Dickey <dickey@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 26 Sep 2007 13:15:34 -0000
Wellu <kuumaliimamies@xxxxxxxxx> wrote:
To me this looks weird but that can be due to fact that this is my
first ncurses program :) Anyway.. Is this kind of programming as "bad"
as it looks? Let's say get_progress_info() function takes 10 ms to
respond. That means that CPU-usage would be 100% all the time which is
vey bad thing. Does getch() really sleep when no keypress is coming?
no - getch() will wait at most 10msec before returning.
If there's no keyboard activity that's 50% usage - assuming no other
processes need time (which would be unusual).
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
.
- Follow-Ups:
- Re: ncurses event loop
- From: Wellu
- Re: ncurses event loop
- References:
- ncurses event loop
- From: Wellu
- ncurses event loop
- Prev by Date: Re: Non-rectangular (shaped) main window that has non-rectangular child windows.
- Next by Date: Re: ncurses event loop
- Previous by thread: ncurses event loop
- Next by thread: Re: ncurses event loop
- Index(es):