Turnaround Time
What You'll Learn
You'll learn how to measure the total time a process spends in the system from arrival to completion—a key metric for evaluating CPU scheduling fairness and efficiency.
The Core Concept
Turnaround Time is the total elapsed time between when a process is submitted (arrives) to the system and when it finishes execution completely. It captures the entire "life experience" of a process from the user's perspective.
The formula is straightforward:
Turnaround Time = Completion Time - Arrival Time
This metric includes everything: time spent waiting in the ready queue, time blocked waiting for I/O, and actual CPU execution time. It's like measuring how long your entire restaurant visit takes—from walking in the door to receiving your check—not just the time the chef spent cooking.
Why It Matters
Turnaround time reflects the user experience. A process with a short CPU burst but long wait times can have poor turnaround time, frustrating users even though the actual work was quick. Scheduling algorithms often try to minimize average turnaround time across all processes to improve overall system responsiveness.
Example Scenario
Imagine three processes:
- Process A arrives at time 0, runs for 5 seconds, completes at time 5
- Turnaround Time = 5 - 0 = 5 seconds
- Process B arrives at time 2, waits until time 5, runs for 3 seconds, completes at time 8
- Turnaround Time = 8 - 2 = 6 seconds
- Process C arrives at time 4, waits until time 8, runs for 2 seconds, completes at time 10
- Turnaround Time = 10 - 4 = 6 seconds
Average turnaround time = (5 + 6 + 6) / 3 = 5.67 seconds
Key Takeaway: Turnaround time measures the complete end-to-end delay a process experiences, making it essential for evaluating how "fair" and efficient a scheduling algorithm is from the user's viewpoint.