sched complete
This commit is contained in:
parent
fc7925be3e
commit
785b4a63ac
|
@ -583,13 +583,20 @@ int main(int argc, char **argv) {
|
|||
output_file << out_strings[i] << endl;
|
||||
}
|
||||
output_file.close();
|
||||
float tot = 0;
|
||||
int count = processes.size();
|
||||
for(int i = 0; i < processes.size(); ++i) {
|
||||
tot += processes[i].completion_time;
|
||||
cout << "Process " << i+1 << " Completion Time: " << processes[i].completion_time << endl;
|
||||
}
|
||||
cout << "Average Completion Time: " << tot/count << endl;
|
||||
tot = 0;
|
||||
for(int i = 0; i < processes.size(); ++i) {
|
||||
tot += processes[i].completion_time - processes[i].cpu_time;
|
||||
cout << "Process " << i+1 << " Waiting Time: " << processes[i].completion_time - processes[i].cpu_time << endl;
|
||||
// cout << "Process " << i+1 << " Waiting Time: " << processes[i].wait_time << endl;
|
||||
}
|
||||
cout << "Average Waiting Time: " << tot/count << endl;
|
||||
|
||||
std::cout << "Execution time: " << duration.count() << " ms" << std::endl;
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue