On 06/27/2014 08:01 PM, Hans-Peter Diettrich wrote:


I don't see an advantage with using relative times, or unsorted lists.
On insertion a binary search over the list can be made, when the entries
are sorted by absolute time. Removal of entries occurs always from the
list head.

Relative Timers supposedly indeed are prone to running out of sync. So I don't do that.

I need to find the lowest

With an average count of - say - three timers in a usual project, I don't suppose that keeping an ordered list (by removing and - after doing a binary search - re-inserting an entry) is less efficient than maintaining the order of the TTimers in the array and do a linear searching for the lowest next timeout value.

-Michael
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to