Process Priority | Arrival Time (in ms) | CPU Time Needed (in ms) | Priority |
P1 | 0 | 10 | 5 |
P2 | 0 | 5 | 2 |
P3 | 2 | 3 | 1 |
P4 | 5 | 20 | 4 |
P5 | 10 | 2 | 3 |
ms | Process |
0 to 2 | P2 (P2 completed 2 ms here) |
2 to 5 | P3 (No wait for P3) |
5 to 8 | P2 (P2 had to wait 3 ms to get executed ) |
8 to 10 | P4 (P4 had to wait 3 ms to get started) |
10 to 12 | P5 (No wait for P5) |
12 to 30 | P4 (P4 had to wait 2 ms to complete its remaining) |
30 to 40 | P1 (Was waiting for 30 ms) |