Wilfried Mestdagh wrote:
you are ritght because working with float is more CPU. But GetTickCount
roll over every 49 day... So without extra code the timeout can fail if
it is (by Murphy's law) just on the particular moment..

It's not that much more code.

NewTime := GetTickCount();
if NewTime > OldTime then
  ElapsedTime := NewTime - OldTime
else
  ElapsedTime := NewTime + (High(Cardinal) - OldTime);

{ Do something with ElapsedTime }

OldTime := NewTime;

--
Sly




This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect.
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to