Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

35 Commits

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

An embarassingly simple progress bar for C++ loops

Topics

Resources

Stars

243 stars

Watchers

3 watching

Forks

Releases

Used by

Contributors

Languages