[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] 100% CPU FAQ



event.wait() will, well, _wait_ for single events while blocking.



On Thu, Jul 31, 2008 at 6:31 PM, Noah Kantrowitz <noah@xxxxxxxxxxxxxx> wrote:
techtonik wrote:
Hello,

I do not know why this question is not present in FAQ yet, but - why
pygame always eats 100% of CPU time?

The following example shows 100% load even with empty event queue when
pygame.event.get() is blocking.

That would be because event.get() doesn't block. If you want to control your framerate (and therefore CPU usage) use pygame.time.Clock.

--Noah