#include <LoadingBar.h>
Definition at line 11 of file LoadingBar.h.
◆ LoadingBar()
LoadingBar::LoadingBar |
( |
int |
nIterations, |
|
|
int |
nSteps = 20 |
|
) |
| |
◆ ~LoadingBar()
LoadingBar::~LoadingBar |
( |
| ) |
|
◆ printTimeDiff()
void LoadingBar::printTimeDiff |
( |
double |
minutes | ) |
|
Definition at line 15 of file LoadingBar.cpp.
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";
◆ update()
void LoadingBar::update |
( |
int |
i | ) |
|
Definition at line 33 of file LoadingBar.cpp.
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;
void printTimeDiff(double minutes)
◆ _nIterations
int LoadingBar::_nIterations |
|
private |
◆ _nSteps
◆ _prevStep
int LoadingBar::_prevStep |
|
private |
◆ _tstart
time_t LoadingBar::_tstart |
|
private |
The documentation for this class was generated from the following files: