Results 1 to 6 of 6

Thread: Time Remaining [Resolved]

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2002
    Posts
    53

    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.

  2. #2
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    //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?

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2002
    Posts
    53
    Hmm, using that type of formula my time left just rise's where it should fall.

  4. #4

    Thread Starter
    Member
    Join Date
    Sep 2002
    Posts
    53
    I'm well stuck, anyone?

  5. #5
    Lively Member
    Join Date
    Jan 2001
    Posts
    79
    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

  6. #6

    Thread Starter
    Member
    Join Date
    Sep 2002
    Posts
    53
    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
  •  



Click Here to Expand Forum to Full Width