-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.cpp
More file actions
24 lines (21 loc) · 789 Bytes
/
main.cpp
File metadata and controls
24 lines (21 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include<iostream>
#include"fileReader.h"
#include"algorithm.h"
using namespace std;
int main(void){
ifstream fd;
fileReader *fr = new fileReader();
if(fr->getFileContents() == -1)
cout << "Failed to open file" << endl;
else{
fr->contentParser();
fr->processParser();
Algorithm *algorithm = new Algorithm(fr->processes_, fr->totalProcesses_);
algorithm->UseAlgorithm();
for(unsigned int i = 0; i < algorithm->doneProcesses_.size();i++){
cout << "Process " << algorithm->doneProcesses_.at(i).pid_ << " Total execution time: "<< algorithm->doneProcesses_.at(i).totalExecutionTime_ << endl;
cout << "Process " << algorithm->doneProcesses_.at(i).pid_ << " Total waiting time: "<< algorithm->doneProcesses_.at(i).totalWaitingTime_<< endl;
}
}
//system("PAUSE");
}