Results 1 to 3 of 3

Thread: download time calculator

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    1

    download time calculator

    Hi.. im making a download time calculator in VBA.

    basicly the user enters in the size of a given page in Bytes.

    I convert this number into Bits.. and then Times it by the given KBs they've selected. Then output the number in seconds into a text box.

    its slowly comming together.. anyone interested in this or in helping me out let me know.

    ill upload it soon if you are.

  2. #2
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: download time calculator

    So, there are few simple calculations I think. By the way what you have done up to now.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  3. #3
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: download time calculator

    It sounds like you could use a method called "dimensional analysis" to help making some of your formulas correctly.

    Here's an example. Say I'm given the size of a file in bytes and a download rate in KB/second, and I want to know how long it will take to finish the download. Since you know that the time it takes to finish the download depends only on the total file size and the download rate, you want to combine the download rate and total file size in some mathematical way that gives the proper dimensions (or units) of the time it takes to finish the download.

    Algebraically, download time = (file size)^n * (download rate)^m for some exponents n and m. Now this sounds complicated, but to be honest it's not after you've looked at an example or two.

    You know download time is in seconds, file size in bytes, and download rate in KB/second or 1000 bytes/second. There's a good reason for this (that I won't get into), but all units must be the same--that is, you can't mix bytes and kilobytes. So before you apply this dimensional analysis, you have to convert the download rate from KB/second to bytes/second.

    Anyway, here are the unts from the above algebraic equation: seconds = (bytes)^n * (bytes/second)^m. To get the "second" out of the denominator, m MUST be -1 (since negative exponents flip fractions). However, if m is -1, then there is a "bytes" in the denominator, which will need to be cancelled out by the "bytes" from the file size, so n MUST be 1.

    Thus, download time = (file size)^1 * (download rate {in bytes/second
    })^-1, or download time = file size/download rate {in bytes/second}.

    This actually works, too. Take the file size to be 1000 bytes, and the download rate to be 1 KB/sec (1000 bytes/sec). Clearly, it should take 1 second to download. The formula says it will take 1000 bytes / (1000 bytes/sec) or 1000 bytes*sec/1000 bytes = 1 sec when simplified, as expected. Similarly, if the download rate is instead 2 KB/sec (2000 bytes/sec), download time = 1000 bytes*sec / 2000 bytes = 0.5 seconds, as expected.


    I'm pretty sure that online articles could explain this better than I have, since this seems really obtuse as I reread it. After a while I'm sure it'll become simpl. In any case, good luck with your project
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

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