![]() ![]() Total_idle_time += (i = 0)?(p.arrival_time):(p.start_time - p.completion_time) Īvg_turnaround_time = (float) total_turnaround_time / n Īvg_waiting_time = (float) total_waiting_time / n Īvg_response_time = (float) total_response_time / n Ĭpu_utilisation = ((p.completion_time - total_idle_time) / (float) p.completion_time)*100 Total_turnaround_time += p.turnaround_time for a given process i: wt i (bt 0 + bt 1 +. P.response_time = p.start_time - p.arrival_time 1- input the processes along with their burst time (bt) and arrival time (at) 2- find waiting time for all other processes i.e. P.waiting_time = p.turnaround_time - p.burst_time P.turnaround_time = p.completion_time - p.arrival_time ![]() P.completion_time = p.start_time + p.burst_time ![]() P.start_time = (i = 0)?p.arrival_time:max(p.completion_time,p.arrival_time) Bool compareArrival(process p1, process p2) ArrayList pairs new ArrayList () Now replace each 'logTime ()' call with: pairs.add (new Pair (time, processState)) When the computation is done you could do sth.![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |