The X window system I am working on has a 3 stage timer built into the TApplication. it is a stak based timer adding timers is as easy as
Code:
Application.AddMsTask('OnTimer',Window,@OnTimer,10);
Application.AddSecTask('OnTimer',Window,@OnTimer,13);
Application.AddMinTask('OnTimer',Window,@OnTimer,22);
the Ontimer is the event handling code and if it return's a True the event will remove itself.
to test it I opened 12 windows with a rotationing object in each. it seems to work very well as long as the load can be handled. I've only tested the AddMsTask so far but I see no reason why the others shouldn't work as expected. My system is built around a very custom linked list design. that allows for managing many lists from a single object. so it made since to build the timer functions into the application rather then creating a bunch of timer objects. this way all events are processed in a single loop including all of the X events.
Bookmarks