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.

-Michael
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to