Gantt Chart Generator for CPU Scheduling Algorithms

A Gantt chart is the timeline of who held the CPU and when. Build it one slice at a time, see each process as its own row, and compare the average waiting and turnaround times of all five algorithms on the same workload.

About this simulator

A Gantt chart is the timeline of which process held the CPU and when. Drawing it correctly is the heart of every scheduling exercise. This tool builds the chart one slice at a time, adds a row per process and compares all five algorithms side by side on the same workload.

How it works

  1. The horizontal axis is time; each block is a stretch where one process ran on the CPU.
  2. Gaps are idle time — no process had arrived yet.
  3. The comparison table runs every algorithm on your processes so you can see which policy is best for this workload.

Formulas used

  • Block start and end times give each process's completion time CTCT
  • Average WT=∑WTn\text{Average } WT = \dfrac{\sum WT}{n}, Average TAT=∑TATn\text{Average } TAT = \dfrac{\sum TAT}{n}

Worked example

Processes P1 (arrival 0, burst 8), P2 (1, 4), P3 (2, 9) and P4 (3, 5) under SRTF produce the chart P1 0–1, P2 1–5, P4 5–10, P1 10–17, P3 17–26. The average waiting time is 6.5. Hatched grey blocks, if any, mark idle CPU time when no process had arrived yet.

Enter these numbers in the simulator above to see every step.

When to use it

  • Verifying a hand-drawn Gantt chart before submitting homework.
  • Comparing algorithms to see which suits a workload.
  • Reading completion, waiting and turnaround times directly from the chart.

Frequently asked questions

How do you read a Gantt chart for CPU scheduling?

The horizontal axis is time. Each block shows one process running on the CPU from its start to its end; gaps mean the CPU was idle.

How do I get waiting time from a Gantt chart?

Find the process's completion time on the chart, subtract its arrival time to get turnaround time, then subtract its burst time.

Why do Round Robin Gantt charts have many small blocks?

Each process runs for at most one time quantum before going to the back of the queue, so long processes are split into several slices.