|
-
Apr 25th, 2003, 05:36 PM
#1
Thread Starter
Member
Time Remaining [Resolved]
Can't seem to get my head around the 'maths' involved in this. I'm doing some file operations, of a particular file operation I know what the total size is, I know what the current size is, I know the percentage if need be (the progress) and also time elapsed, what calculation do I need to get the estimated time remaining?
Two varibles, TotalSize & CurrentPosistion, hold the total file size and current posistion.
Code:
'I get percentage like this
CurrentPosistion * 100 / TotalSize
Using Environment.TickCount I have another varible that hold a count of time past since I started counting.
Code:
'I get time elapsed like this
(ElapseTime \ 60).ToString("00") & "." & (ElapseTime Mod 60).ToString("00")
So, like I say, I have current posistion, total posistion, current percentage and time elapsed, I can't quite get the calculation for estimated time remaining.
Can anyone help?
Last edited by JustAProg; Apr 27th, 2003 at 09:12 AM.
-
Apr 25th, 2003, 06:26 PM
#2
Fanatic Member
//So, like I say, I have current posistion, total posistion, current percentage and time elapsed, I can't quite get the calculation for estimated time remaining.
Ideally, if you know the total size, and you already know the percent complete so far, then guesstimating time remaining should be simple:
Let's say you have a file that is 100mb in size.
Let's say that when you check, you have copied 10mb in 10 seconds.
With a simple example like this, it ought to be obvious that when you have copied 10% of the file, and 90 seconds remain until completion. Showing my work:
10mb / 100mb = .1, that's the ratio complete: .1, or 10 percent
10sec * 1/.1, or 10sec * 10, that's 100 seconds (estimate of how long the operation will take)
100sec - 10sec = 90 seconds remaining.
Make sense?
-
Apr 25th, 2003, 08:27 PM
#3
Thread Starter
Member
Hmm, using that type of formula my time left just rise's where it should fall.
-
Apr 27th, 2003, 04:54 AM
#4
Thread Starter
Member
-
Apr 27th, 2003, 08:26 AM
#5
Lively Member
My Guess
Suppose E = time elapsed
S = Total Size
C= Already Copied
try
Time Remaining= E* ((S/C)-1)
Make sure that C>0 before the calculation.
I have not tried it, I just derived a small equation.
Hope that helps
-
Apr 27th, 2003, 09:12 AM
#6
Thread Starter
Member
wow, cool, you're the man
Works fine.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|