🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #9644

Re: CopyFileEx - CopyProgressRoutine - devision by zero

#9644
From: Bob Gonder
Date: Sat, 26 Jun 2004 04:52
34 lines
3078 bytes
Tommy wrote:

>i could find the error yet. i set startime with this code:
>
>GetSystemTimeAsFileTime(&StartTime.ft);

Well, as long as you have that problem, your next reported problem
will happen too, caused by the fluctuating elapsed time.

Nail down the StartTime changing problem first.  The rest will become
more clear.

>As i said the the time which is already need till the process is finished
>works fine. but there is one small thing i do not like. the time differents
>fluctuates very much. so my application shows that the process will be ready
>in 5 minutes, but one seconds later in takes 5 hours. this depends on if
>there are many small files copying at the moment or larger files.
>
>is there perhabs any better way to calculate the time which is still need
>without these large time fluctuations. when i copy completly large folder
>under windows the information how long the process still needs does not show
>such much fluctuations. so there should be a better way.

Once you get you elapsed time problem fixed, if it still changes too
much, you could go into higher mathematics, and practice curve
smoothing.  You'll probably need a good book on statistical methods to
figure that one out.

The reason you don't see MS's time jumping around, is, first, they
wait quite a while before displaying the first approximation. so they
have quite a bit of history to extrapolate from. Second, they don't
give very accurate figures.  Even then, if you watch a long copy, you
will see the figures change up and down.  I've seen it finish copying
with still "10 minutes remaining".
Technical Details
Message-ID: <m2vpd0l06l91eao52ocipl1cg9e5a7up09@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!newsfeed.icl.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <crtsc0pp05ki34cqsvkgsj721eei6g7obh@4ax.com> <40cef067$1@newsgroups.borland.com> <8hauc01e3dsrlu787m5s8jo10rpu0k3duq@4ax.com> <40d3589b@newsgroups.borland.com> <2bj7d0dc8b89se5ibtdm7nntbvsrga2lrt@4ax.com> <40d8b34c$1@newsgroups.borland.com> <qfojd0dhd57q45be09tt1u8klea9fglliq@4ax.com> <40d9f233@newsgroups.borland.com> <uavjd0lvdhuhdvosclehlarvvfagceecmn@4ax.com> <40db5933@newsgroups.borland.com> <ik7nd0tm3ks2oj5g6r0okaarr2g94kk97u@4ax.com> <40dcaf31@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9a3709a4832c0e51
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: CopyFileEx - CopyProgressRoutine - devision by zero
Date: Fri, 25 Jun 2004 21:52:00 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <m2vpd0l06l91eao52ocipl1cg9e5a7up09@4ax.com>
References: <crtsc0pp05ki34cqsvkgsj721eei6g7obh@4ax.com> <40cef067$1@newsgroups.borland.com> <8hauc01e3dsrlu787m5s8jo10rpu0k3duq@4ax.com> <40d3589b@newsgroups.borland.com> <2bj7d0dc8b89se5ibtdm7nntbvsrga2lrt@4ax.com> <40d8b34c$1@newsgroups.borland.com> <qfojd0dhd57q45be09tt1u8klea9fglliq@4ax.com> <40d9f233@newsgroups.borland.com> <uavjd0lvdhuhdvosclehlarvvfagceecmn@4ax.com> <40db5933@newsgroups.borland.com> <ik7nd0tm3ks2oj5g6r0okaarr2g94kk97u@4ax.com> <40dcaf31@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 65.173.66.198
X-Trace: newsgroups.borland.com 1088225549 65.173.66.198 (25 Jun 2004 21:52:29 -0700)
Lines: 38
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!newsfeed.icl.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail