ProgressBar
Loading...
Searching...
No Matches
test.cpp

Simpest usage of ProgressBar

#include <unistd.h>
#include "PBar.hpp"
void DoSomething() {usleep(1e3);}
int main()
{
std::cout << "Congratulations: compilation was succesful" << std::endl;
for (int i = 0; i < 1e3; i++)
{
pBar.Print(static_cast<double>(i)/(1e3 - 1.));
DoSomething();
}
// if the progress that is passed to pBar.Print(counter) goes beyond 1. the following
// function will be called automaticaly and the ProgressBar will no longer be printed
pBar.Finish();
}
Contains declaration of class ProgressBar.
Class ProgressBar can be used used to print the progress in an ascii horizontal bar....
Definition PBar.hpp:34
void Print(const double progress)
Prints bar.
Definition PBar.cpp:115
void Finish()
Finishes the bar and clears it.
Definition PBar.cpp:127