[Lazarus] Do I understand how OnIdle works?

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Jul 27 12:25:12 CEST 2020


On Mon, 27 Jul 2020 12:05:45 +0200
frans via lazarus <lazarus at lists.lazarus-ide.org> wrote:

> Hi,
> 
> I wonder about the use of OnIdle procedure and the Done variable. I 
> thougth that this routine keeps running over and over again in idle 
> state as long as Done=False.

Correct.

> But the value of Done doesn't make a 
> difference, the OnIdle procedure  keeps repeating itself even when 
> Done=True.
> Can anyone explain this to me?

Some OS like Windows generate a lot of messages, so OnIdle is called
often, sometimes several times per second without the user
touching anything.
Look in the task manager if your app is generating cpu load. If not
then it is probably not your apps fault.

Mattias



More information about the lazarus mailing list