Results 1 to 5 of 5

Thread: Calculate Time Remaining

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    195

    Calculate Time Remaining

    This isn't specifically a VB problem, but I'm sure someone here can answer it.

    I need to estimate the time remaining for a process. The variables which I want to calculate it with are the completion ratio (0 - 1), and the time that has elapsed since the process began.

    From this I should be able to calculate how many more seconds remain, right? Well I don't know the maths of it, so can anyone help me out?
    Using Visual Studio .NET 2005

  2. #2
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    Re: Calculate Time Remaining

    Originally posted by Barguast
    This isn't specifically a VB problem, but I'm sure someone here can answer it.

    I need to estimate the time remaining for a process. The variables which I want to calculate it with are the completion ratio (0 - 1), and the time that has elapsed since the process began.

    From this I should be able to calculate how many more seconds remain, right? Well I don't know the maths of it, so can anyone help me out?
    well the question is sufficiently vague

    If you are looping i = 1 to 1000 you could calculate percent complete as i/1000 and use the system time to track seconds/minutes/etc

    That what you mean?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    195
    I need it for a file encryptor. Let's say that the encryptor is 80% complete, then the ratio would be 0.8. If this was done in 16 seconds, then you can work out that the encryption will be complete in about 4 seconds.
    I just can't seem to work out how the convert the above into an equation.
    Using Visual Studio .NET 2005

  4. #4
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    Originally posted by Barguast
    I need it for a file encryptor. Let's say that the encryptor is 80% complete, then the ratio would be 0.8. If this was done in 16 seconds, then you can work out that the encryption will be complete in about 4 seconds.
    I just can't seem to work out how the convert the above into an equation.
    (Now - StartTime) / PercentComplete

    Thats the psuedo code anyway ... If you are using VB6 youd use DateDiff with Now and StartTime as arguments ...

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    195
    A-ha, that calculates the total time the process will take. I can work from that, thanks
    Using Visual Studio .NET 2005

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