-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckProgression.cpp
More file actions
31 lines (26 loc) · 1.01 KB
/
Copy pathCheckProgression.cpp
File metadata and controls
31 lines (26 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <time.h>
#include "progressionOutput.h"
CheckProgression::CheckProgression(double stoptime, bool testing)
{
timestarted = time(&timer);
tStop = stoptime;
}
void CheckProgression::showProgression(double time)
{
percent = calculateProgression(double time); // Prints the progression
}
int CheckProgression::CheckProgression(double time)
{ double currentTime = time(&timer);
if (int((time/tStop)*100)%10 == 0 && int((time/tStop)*100) != percent ){
cout << int((time/tStop)*100) << "% done| " << curretenTime- start << " Sec used| estimated " << round((curretenTime - start)/(time/tStop) - (curretenTime - start)) << " Sec left" << endl;
return int((time/tStop)*100);
}
}
bool CheckProgression::doneTesting()
{
if(int(time(&timer)-timeStarted)>=testTime){
cout << "I am estimating it will take approximately " << int(double(time(&timer)-timeStarted)/(t/inputReader->tStop)) << " Sec" << endl << "Test ended" << endl;;
return true;
}
else{return false;}
}