Hone

Lessons · IT support · how long a download takes

How long a file takes: bytes times eight, over bits per second

Files are measured in bytes and lines in bits per second, and there are 8 bits in a byte. Time in seconds = size in megabytes × 8 ÷ speed in megabits per second. Both use the same million, so no other conversion is needed.

Hone is a place to practise a career, one idea a day. This is one of its lessons, written out in full and free to read without an account.

What it is for

A user needs a 700 MB video sent to a client before a 14:00 call and asks whether their 50 Mbps line will do it in ten minutes. It will do it in under two, if the line is really 50, and knowing that stops the panic and the second ticket asking for a faster connection. It also lets you say 'four minutes at the speed you are actually getting' when the line is not really 50.

How to think about it

Write the size in megabytes and the speed in megabits per second, then multiply the size by 8 and divide by the speed. The answer is in seconds; divide by 60 if you want minutes. If a size is in gigabytes, multiply by 1000 first. Then compare with what the line really measures at, because a 50 Mbps line at lunchtime is often a 20 Mbps line.

Worked example

700 MB × 8 = 5,600 Mb
Bytes to bits. Same million on both sides, so only the 8 changes.
5,600 Mb ÷ 50 Mbps = 112 s
Bits over bits per second gives seconds. Just under two minutes.
Measured speed at lunchtime: 20 Mbps → 5,600 ÷ 20 = 280 s
The same file on the line as it really is. Four minutes forty. Still before the call.

Your turn

A 4,000 MB update on a 20 Mbps line. Write the time in seconds.

4000 × 8 / 20 =  s

The trap

Dividing megabytes by megabits and getting an answer eight times too small. 700 divided by 50 is 14 seconds, and it is wrong by exactly the 8 you forgot. A 'B' is a byte; a 'b' is a bit; the line is sold in the small one.

Practise how long a download takes on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.