[Lazarus] Lazarus and Application.ProcessMessages

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Dec 3 23:43:36 CET 2014


On Wed, 03 Dec 2014 16:37:38 -0600
"Terry A. Haimann" <terry at haimann.us> wrote:

> I have a program that starts some background processes and then needs to
> go to sleep for 15 seconds or so and then come back and check on their
> statuses.  So I used a loop like the following:


EndTime := Now + EncodeTime(0, 0, 15, 0);  
While (Now < EndTime) and not WaitingCancelled do begin
  Application.ProcessMessages;
  Sleep(10);
end;
 
> The problem  is that the core this process runs on is running 60-80% cpu
> utilization.  Is there away to do something like this and not max the
> core out?  This computer is an i5 Desktop running Linux Mint 17-64.


Mattias




More information about the Lazarus mailing list