Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Mar : Re: idhttp calculation problem , need help!

www.cryer.info
Managed Newsgroup Archive

Re: idhttp calculation problem , need help!

Subject:Re: idhttp calculation problem , need help!
Posted by:"John Herbster" (herb-sci1_at_sbcglobal.net)
Date:Sat, 8 Mar 2008 12:02:38

"inqontrol" <team@odium.to> wrote
> ... I'm coding a lot of applications for up- and downloading files ...
> But on some client computers the speed, progress and time-left
> calculations go crazy. I use ...
>    newtime := GetTickCount; //latest time
> ...
>    speed := (pos - fOldBytes) / (newtime - fLastTime); //calculate Bytes/s

Inqontrol,
I suspect that your code might be having problems with using the DWORD GetTickCount as an integer.   Does your code have overflow checking turned on?  It should have caught this problem.
Also, you may need to allow for the 49-day rollover of GetTickCount.
HTH, JohnH

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive