What is the difference between turnaround time, waiting time and response time?
Turnaround time is completion minus arrival. Waiting time is turnaround minus burst, the total time spent in the ready queue. Response time is the time from arrival to the first time the process gets the CPU.
Explain it simply
Think of ordering at a restaurant. Turnaround is the time from ordering until you finish your meal. Waiting is the time you sat with nothing happening. Response is how long until the waiter first reacts to you.
- Turnaround time = completion time - arrival time
- Waiting time = turnaround time - burst time
- Response time = first CPU time - arrival time
Interactive systems care most about response time. Batch systems care about turnaround and throughput.
Example
FCFS with two processes:
| Process | Arrival | Burst |
|---|---|---|
| P1 | 0 | 5 |
| P2 | 1 | 3 |
| P1 (5) | P2 (3) |
0 5 8P1: completion 5, turnaround 5 - 0 = 5, waiting 5 - 5 = 0, response 0 - 0 = 0.
P2: completion 8, turnaround 8 - 1 = 7, waiting 7 - 3 = 4, response 5 - 1 = 4.
Under FCFS, response equals waiting because a process never gets the CPU twice. Under Round Robin they differ: a process may get its first slice early (small response time) but wait again later.
What to say in the interview
"Turnaround is completion minus arrival, waiting is turnaround minus burst, and response is first run minus arrival. In non-preemptive FCFS response and waiting are the same, but in Round Robin response is much smaller than total waiting."
Common mistakes
- Calling response time the time until completion.
- Forgetting that waiting time excludes the burst time.