[fpc-devel] TTimers and TThreads. Attn Michael Schnell

Michael Schnell mschnell at lumino.de
Fri Jun 27 13:10:24 CEST 2014

On 06/27/2014 12:54 PM, Giuliano Colla wrote:
> 1) a list of timer events, ordered by expiration time.
Thanks for the pointers.

I in fact do something similar.

My TTimer class has a class variable that is a dynamic array of TTimers.

When the program is going to wait for anything (a timer or a thread 
firing an event) it searches for the next timer to expire and uses the 
difference time as a waiting timeout.

I don't sort the list, as it would need to be re-sorted with any timer 
event. So I always need to do a linear search for the next Timer to expire.


More information about the fpc-devel mailing list