Skip to content

Repository files navigation

progressbar

A very simple, header-only, fully customizable, progress bar (with percentage) for c++ loops.

Very simple to set up:

#include"progressbar.hpp"intmain() {
progressbar bar(100);
for (int i = 0; i < 100; ++i) {
bar.update();
// ... the program
}
return0;
}

animated gif

Allows customization:

#include"progressbar.hpp"intmain() {
progressbar bar(100);
bar.set_todo_char("");
bar.set_done_char("");
bar.set_opening_bracket_char("{");
bar.set_closing_bracket_char("}");
for (int i = 0; i < 100; ++i) {
bar.update();
// ... the program
}
return0;
}

animated gif

Notes

To use the bar in parallelized loops call progressbar::update in a critical section. With OpenMP this can be achieved with the following structure:

#pragma omp parallel for
for ( ... ) {
#pragma omp critical
bar.update();
}

About

A very simple progress bar for c++ loops

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages