Skip to content

Commit

Permalink
[readme] add advanced example
Browse files Browse the repository at this point in the history
  • Loading branch information
Luigi Pertoldi committed Oct 6, 2019
1 parent eab4fd2 commit 6e4e326
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Binary file added .github/example-custom.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# progressbar

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

Very simple to set up:
```cpp
#include "progressbar.hpp"

Expand All @@ -15,7 +18,27 @@ int main() {
```
![animated gif](.github/example-simple.gif)

This comment has been minimized.

Copy link
@rajaalyjibran

rajaalyjibran Jan 25, 2023

kuch samaj nahi aya bc

Allows customization:
```cpp
#include "progressbar.hpp"

int main() {
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
}
return 0;
}
```
![animated gif](.github/example-custom.gif)

## Notes

To use the bar in parallelized loops call `progressbar::update` in a critical
section. With [OpenMP](http://www.openmp.org) this can be achieved with the
following structure:
Expand Down

0 comments on commit 6e4e326

Please sign in to comment.