4 _nIterations(nIterations),
18 int hours = floor( minutes / 60.0 );
19 int mins = floor( minutes - hours*60.0 );
20 std::cout << hours <<
"h " << mins;
22 else if (minutes < 60.0 && minutes > 1.0){
23 int mins = floor( minutes );
24 int seconds = floor(
double( minutes - mins )*60.0 );
25 std::cout << mins <<
"m " << seconds;
28 int seconds = floor( (minutes)*600.0 );
29 std::cout << seconds*0.1 <<
"s";
36 int steps = floor(
_nSteps*frac);
38 int per = floor(100*frac);
43 double delT = difftime(time(0),
_tstart);
45 double detTMins = delT / 60.0;
46 double evtsPerMin = (double(i)/detTMins);
49 double remainingTime = totalTimeMins*(1.0-frac);
53 for (
int j = 0; j <
_nSteps; j++){
54 if (j < steps) std::cout <<
"=";
55 else std::cout <<
" ";
58 std::cout <<
"] " << per <<
"% Complete. ";
60 std::cout <<
" left. " << std::flush;
68 double delT = difftime(time(0),
_tstart);
69 double detTMins = delT / 60.0;
72 std::cout <<
"\r Completed in ";
74 std::cout <<
" which is " << floor(evtsPerMin) <<
" iterations/min " << std::flush << std::endl;
LoadingBar(int nIterations, int nSteps=20)
void printTimeDiff(double minutes)