[fpc-pascal] Timer in X11

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Thu Dec 22 09:15:16 CET 2011



On Thu, 22 Dec 2011, Graeme Geldenhuys wrote:

> On 21 December 2011 18:06, Henry Vermaak wrote:
>> embedded devices, laptops have batteries, too.  You're wasting CPU and power
>> just spinning around a loop, so even if your app isn't active, it's still
>> waking up every 50ms.  I don't consider this very good programming practice.
>
> I'm always interested in improvements. The 50ms code was done purely
> to implement the Application.OnIdle() event. How else can I implement
> an OnIdle event then?

I think it depends on what you mean with 'OnIdle'.
- An event which occurs once when an application falls Idle.
- An event which is triggered repeatedly when the application is idle.

As I understand it, Delphi and Lazarus implement the former, and 
don't need a timeout for it.

Michael.


More information about the fpc-pascal mailing list