Turnaround time is the time that passes between when a process is submitted and when it is completed. The time taken to execute on the CPU and wait in the ready queue can be regarded as turnaround time. When assessing the operating system’s scheduling algorithms, turnaround time is a crucial measure. On the other hand, the period between the process’ entry into a waiting queue and the time it is fully completed is referred to as the waiting time. So, waiting time equals departure time minus arrival time. The overall output speed impacts the turnaround time. On the other hand, the waiting time has no impact because of the output rate.
What is Turnaround Time?
Turnaround time (TAT) is between the submission moment and the time the procedure is finished. It can be viewed as the total of the time spent waiting to execute on the CPU, execute on memory, or execute input/output. Turnaround time is essential for assessing an operating system’s scheduling algorithms.
In particular, for multiprocessor systems, turnaround time is crucial in the design of microprocessors. Hardware design firms favour quicker turnaround designs since they result in faster results and computing rates.
CT (Completion Time) – At completion time, a process has completed running.
Arrival time refers to when a process begins before the condition of readiness (before its execution).
Consequently, CT – AT = TAT.
Example
We can utilise the above table to understand turnaround time better. The final Gantt Chart is displayed if we utilise the Robin Hood scheduling scheme and retain the time quantum at three seconds. Using the first formula, we can then get the turnaround time for each of the following processes:
P1: 3 0 = 3 seconds
P2: 4 9 = 13 seconds
P3: 4 7 = 11 seconds
P4: 4 6 = 10 seconds
What is Waiting Time?
The time a process spends waiting in a ready queue before sending it to the CPU is known as waiting time (WT). The waiting time of a process is the interval between turnaround time and burst time. Burst time, often known as BT (Burst Time), is the overall amount of time a process needs to run.
In general terms, CPU wait refers to the time it takes for a thread or program to execute, which is an essential component of systems’ triaging for the use of multiple processors or parallel processing. Sharing resources, particularly processing power and time, is one of the main issues with virtualized systems. Administrators must become very knowledgeable about monitoring systems to assess how effectively a system performs. They must be able to tell how long jobs are waiting to be executed and CPU wait times.
TAT – BT = WT as a result.
The Bursting Time and the Waiting Time can also be used to calculate the Turnaround Time easily.
BT WT = TAT.
Example
We can determine the waiting time for each procedure by using a turnaround time example.
0 seconds in P1.
9 seconds for P2
7 seconds for P3
6 seconds for P4.
CPU scheduling:
CPU scheduling is a technique that allows one process to use the CPU while another’s execution is concurrently put on hold (in a waiting state). This occurs due to a lack of resources, including I/O, etc. The CPU is thus fully utilised as a result. CPU scheduling’s main goal is to improve the system’s effectiveness, speed, and fairness.
The Difference system must select one of the processes in the ready queue to be performed whenever the CPU becomes idle. The short-term scheduler is used to assist in the selection process. The scheduler picks a method for the CPU to employ out of those in memory that are available for execution.
Difference Between Turnaround Time and Waiting Time:
Turnaround time | Waiting time |
The period from when the process was added to the execution queue until it was finished. | The amount of time a process took to complete I/O and move up the ready queue. |
Different CPU scheduling strategies result in different TATs for the same set of operations. | The CPU Scheduling Algorithm only influences how long a process waits in the ready queue, not how long it takes for a process to run or perform I/O |
The output device’s speed typically constrains the turnaround time. | Waiting time doesn’t have a significant impact. |
Burst time plus waiting time equals turn-around time. | Turnaround minus burst time equals waiting time. |