How to use the CPU Scheduling Calculator
- 1. Enter the processesOne per line: name, arrival time, burst time, and priority if needed.
- 2. Choose the algorithmPick FCFS, SJF, SRTF, Priority or Round Robin with a time quantum.
- 3. Check your answerSee the Gantt chart, the per-process table and the averages.
Formulas used
- Completion time (CT): when the process finishes.
- Turnaround time (TAT) = CT − arrival time.
- Waiting time (WT) = TAT − burst time.
- Response time (RT) = first time on the CPU − arrival time.
Worked example (FCFS): P1 (0, 5), P2 (1, 3), P3 (2, 8), P4 (3, 6). They run in arrival order: P1 0–5, P2 5–8, P3 8–16, P4 16–22. Turnaround times are 5, 7, 14 and 19, so the average TAT is 45 ÷ 4 = 11.25. Waiting times are 0, 4, 6 and 13, so the average WT is 23 ÷ 4 = 5.75. The calculator shows exactly these numbers for the sample input.
How each algorithm picks the next process
- FCFS: whoever arrived first. Simple, but one long job makes everyone wait (the convoy effect).
- SJF: the shortest burst among the processes that have arrived, and it runs to the end.
- SRTF: the preemptive version of SJF. A new arrival with less remaining time takes over the CPU.
- Priority: the lowest priority number goes first. The preemptive version switches as soon as a more important process arrives.
- Round Robin: each process gets a fixed time quantum in turn.
With Round Robin and quantum 2 on the same four processes, the averages become WT 9.75 and TAT 15.25: fairer response, but more waiting overall. When a new process arrives at the same moment a quantum ends, this tool puts the new arrival in the queue before the process that was just preempted, which is the convention most textbooks use. Ties are broken by arrival time, then by input order.
Frequently asked questions
Does a lower priority number mean higher priority?
Yes, in this calculator 1 is more important than 2. If your question uses the opposite rule, reverse your numbers before entering them.
Why do my Round Robin answers differ from my book?
Usually because of the tie rule when a process arrives exactly as a quantum ends. This tool adds the new arrival to the queue first.
Can I enter decimal times?
No, times must be whole numbers, which is how almost all exam questions are set.
Is the calculator free?
Yes, free to use. Enter your processes freely; we ask for a name and WhatsApp number once when you see your first schedule, and never again on any Uncodemy tool.