CPU Scheduling Calculator
Shortest remaining time first always runs the job closest to finishing: these four processes give an average waiting time of 6.5.
Lower priority number = higher priority. Processes are named P1, P2, … in this order.
6.5
- Average turnaround time
- 13
- Average response time
- 4.25
- Throughput (processes per unit time)
- 0.1538461538
- CPU utilisation
- 100 %
- Gantt chart
- P1 [0–1] → P2 [1–5] → P4 [5–10] → P1 [10–17] → P3 [17–26]
| Process | Arrival | Burst | Completion | Turnaround | Waiting | Response |
|---|---|---|---|---|---|---|
| P1 | 0 | 8 | 17 | 17 | 9 | 0 |
| P2 | 1 | 4 | 5 | 4 | 0 | 0 |
| P3 | 2 | 9 | 26 | 24 | 15 | 15 |
| P4 | 3 | 5 | 10 | 7 | 2 | 2 |
Step-by-step solution
- Turnaround = completion − arrival; waiting = turnaround − burst; response = first run − arrival
- Gantt: P1 [0–1] → P2 [1–5] → P4 [5–10] → P1 [10–17] → P3 [17–26]
- Average waiting = 9 + 0 + 15 + 2 ÷ 4 = 6.5
CPU Scheduling Formula
TAT = completion − arrival, WT = TAT − burst
response = first run − arrival
Worked Example
Four processes arriving at 0, 1, 2 and 3 with bursts 8, 4, 9 and 5 under SRTF:
- Turnaround = completion − arrival; waiting = turnaround − burst; response = first run − arrival
- Gantt: P1 [0–1] → P2 [1–5] → P4 [5–10] → P1 [10–17] → P3 [17–26]
- Average waiting = 9 + 0 + 15 + 2 ÷ 4 = 6.5
Average response time: 4.25 · Throughput (processes per unit time): 0.1538461538 · CPU utilisation: 100 % · Gantt chart: P1 [0–1] → P2 [1–5] → P4 [5–10] → P1 [10–17] → P3 [17–26]
| Process | Arrival | Burst | Completion | Turnaround | Waiting | Response |
|---|---|---|---|---|---|---|
| P1 | 0 | 8 | 17 | 17 | 9 | 0 |
| P2 | 1 | 4 | 5 | 4 | 0 | 0 |
| P3 | 2 | 9 | 26 | 24 | 15 | 15 |
| P4 | 3 | 5 | 10 | 7 | 2 | 2 |
GATE tip
Draw the Gantt chart first, then fill the table: completion times come straight from the chart. Switch the algorithm here to compare answers to the same question.
More Operating Systems Calculators
-
Page Replacement Calculator
hit ratio = hits ÷ references
FIFO evicts the oldest, LRU the least recently used, Optimal the one used furthest ahead
Example: The reference string 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 with 3 frames: Page faults = 12.
-
Disk Scheduling Calculator
total movement = Σ |cylinderᵢ₊₁ − cylinderᵢ|
SCAN goes to the disk end; LOOK turns at the last request
Example: Requests 98, 183, 37, 122, 14, 124, 65, 67 with the head at 53 moving towards 0, SCAN: Total head movement = 236 cylinders.
-
Banker’s Algorithm Calculator
Need = Max − Allocation; run Pᵢ if Needᵢ ≤ Work
then Work = Work + Allocationᵢ
Example: Silberschatz’s five processes and three resource types with Available (3, 3, 2): State = safe, sequence ⟨P1, P3, P4, P0, P2⟩.
-
Paging Calculator
page table size = 2^(VA − offset) × PTE
EAT = h(t + m) + (1 − h)(t + 2m)
Example: A 32-bit virtual address, 4 KB pages and 4-byte page table entries: Page table size = 4194304 bytes.
Frequently asked questions
Which algorithm gives the minimum average waiting time?
SJF (and SRTF when preemption is allowed) is optimal for average waiting time, but needs burst times in advance and can starve long jobs.
How are ties handled in Round Robin?
This calculator follows the usual textbook convention: a process arriving during a time slice joins the queue before the preempted process.
Sources
Last reviewed: . Factors are stored exactly and computed with 50-digit decimal arithmetic. See how we verify conversion factors.
Cite this page
APA
Scientific Converters. (2026, October 15). CPU Scheduling Calculator. Retrieved October 25, 2026, from https://scientificconverters.com/calculators/cpu-scheduling-calculator/
IEEE
Scientific Converters, "CPU Scheduling Calculator," scientificconverters.com. Accessed: Oct. 25, 2026. [Online]. Available: https://scientificconverters.com/calculators/cpu-scheduling-calculator/