Indy 9
|
function GetTickDiff(const AOldTickCount: Cardinal; const ANewTickCount: Cardinal): Cardinal;
GetTickDiff handles this situation in calculating the elapsed tick count. When ANewTickCount is greater than (or equal to) AOldTickCount, the return value is calculated using:
ANewTickCount - AOldTickCount;
When ANewTickCount is less than AOldTickCount, the return value is adjusted and calculated using:
High(Cardinal) - AOldTickCount + ANewTickCount;
GetTickDiff is used when calculating the values returned in TIdEcho.EchoTime and TIdEchoUDP.EchoTime, as well as the values returned in TIdTime.RoundTripDelay and TIdTimeUDP.RoundTripDelay.