[fpc-pascal] Timer in X11
Martin Schreiber
mse00000 at gmail.com
Wed Dec 21 17:11:24 CET 2011
On 12/21/2011 04:53 PM, Henry Vermaak wrote:
> On 21/12/11 14:53, Felipe Monteiro de Carvalho wrote:
>> wow, I started taking a look at how to do it and as always with
>> anything related to X11 it is terribly complicated ... but luckly I am
>> not alone here using FPC, so I shamelessly stole code from fpgui,
>> hammered it a little bit to fit TTimer and TCDTimer and already have a
>> initial TTimer for X11. If anyone wants to know how I did:
>>
>> http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&root=lazarus&revision=34350
>>
>
> Spinning like this is bad news for efficiency and battery life of
> embedded devices.
>
MSEgui has another method with a list of timer events.
http://gitorious.org/mseide-msegui/mseide-msegui/blobs/master/lib/common/kernel/msetimer.pas
On Linux it uses timer signals to build the time steps with microseconds
resolution.
Martin
More information about the fpc-pascal
mailing list