Latency

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Latency

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does latency measure?
A How much data can be sent at once
B The delay between sending data and it arriving
2. Which unit is latency usually measured in?
A Milliseconds (ms)
B Megabytes (MB)
3. A ping test shows 20 ms. What does this number tell you?
A It took 20 milliseconds for a small message to travel and get a reply
B The network can carry 20 megabits of data every second
4. Which connection has the lower latency, and so feels faster to react?
A Ping of 250 ms
B Ping of 15 ms
5. Is this statement true? A connection can have high bandwidth and high latency at the same time.
A True: lots of data can be sent at once, but each piece still arrives after a long delay
B False: high bandwidth always means low latency

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1ping 8.8.8.8 -> time=24 ms Abandwidth = 500 Mbps; latency = 600 ms
2latency = 300 ms Bif latency < 50: game = 'smooth'
3Latency is not the same as bandwidth: you can have a high bandwidth link with high latency. CA high delay between sending data and it arriving, which makes video calls and online games lag.
4Online games need low latency so your moves reach the server quickly. DBandwidth and latency are different. A connection can have high bandwidth and still have high latency, which causes lag in video calls.
5latency = 40 Mbps EA ping test shows the round-trip delay, or latency, to another computer. Here the delay was 24 milliseconds.
6High bandwidth always means low latency, so a video call will never lag. FLatency is measured in milliseconds (ms), not Mbps. Mbps is a unit for bandwidth.

Definitions

latency

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
____ example.com
2.
IF latency _ 50 THEN OUTPUT "Smooth"
3.
latency = arriveTime - ________
4.
IF _______ > 150 THEN OUTPUT "Laggy"
5.
lagging = bandwidthHigh ___ latencyHigh

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A latency_ms = 20
B latency_mbps = 20
C print(latency_ms, "ms")
Question 2
A ping_ms = 120
B if ping_ms > 100:
C print("Game lags")
D else
E print("Smooth")
Question 3
A latency = 40
B bandwidth = 500
C print("Latency:", latency)
D print("Bandwidth:", latency)
Question 4
A delay_ms = "300"
B if delay_ms > 150:
C print("Video call lags")
Question 5
A ping_ms = 30
B if ping_ms < 50:
C print("High latency")

Answer Key

Latency
Section A: Quick Questions
Q1
B — The delay between sending data and it arriving
Q2
A — Milliseconds (ms)
Q3
A — It took 20 milliseconds for a small message to travel and get a reply
Q4
B — Ping of 15 ms
Q5
A — True: lots of data can be sent at once, but each piece still arrives after a long delay
Section B: Match the Pairs
Q1
ping 8.8.8.8 -> time=24 ms → A ping test shows the round-trip delay, or latency, to another computer. Here the delay was 24 milliseconds.
Q2
latency = 300 ms → A high delay between sending data and it arriving, which makes video calls and online games lag.
Q3
Latency is not the same as bandwidth: you can have a high bandwidth link with high latency. → bandwidth = 500 Mbps; latency = 600 ms
Q4
Online games need low latency so your moves reach the server quickly. → if latency < 50: game = 'smooth'
Q5
latency = 40 Mbps → Latency is measured in milliseconds (ms), not Mbps. Mbps is a unit for bandwidth.
Q6
High bandwidth always means low latency, so a video call will never lag. → Bandwidth and latency are different. A connection can have high bandwidth and still have high latency, which causes lag in video calls.
Section C: Definitions
Q1
latency — The delay between sending data and it arriving, measured in milliseconds (ms). It is not the same as bandwidth, which is how much data can be sent at once. Low latency feels fast.
Section D: Fill in the Blanks
Q1
ping example.com
Q2
IF latency < 50 THEN OUTPUT "Smooth"
Q3
latency = arriveTime - sendTime
Q4
IF latency > 150 THEN OUTPUT "Laggy"
Q5
lagging = bandwidthHigh AND latencyHigh
Section E: Spot the Error
Q1
B — Latency is a delay measured in milliseconds (ms), not Mbps. Mbps is a unit for bandwidth. The variable should be named latency_ms.
Q2
D — The else line needs a colon at the end. It should be else:
Q3
D — This line is labelled Bandwidth but prints the latency variable. Latency and bandwidth are different measures. It should print bandwidth.
Q4
A — The quotes make 300 a string, so it cannot be compared with the number 150. The delay should be a number: delay_ms = 300
Q5
C — A ping time of 30 ms is below 50, so it is low latency. The message should say Low latency, not High latency.