Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bar not updating right #8

Open
Billkyriaf opened this issue Nov 12, 2022 · 1 comment
Open

Bar not updating right #8

Billkyriaf opened this issue Nov 12, 2022 · 1 comment

Comments

@Billkyriaf
Copy link

The bar is not updating right when the number of iterations is less than 52

Steps to reproduce:

Use the following for loop

progressbar p_bar(29);

for (int i = 0; i < 29; ++i){
    bar.update();

   // Do the work...
}

Expected Output upon completion:

[################################################] 100%

Actual output upon completion:

[   # #      # #    # # #    # #      # #    # ##] 100%
@GuangchenJ
Copy link

GuangchenJ commented Jun 26, 2023

Just use the update function some times, for example

int main() {
  int repeat_num = 5;
  progressbar bar(10 * repeat_num);
  for (int i = 0; i < 10; ++i) {
    for (int j = 0; j < repeat_num; ++j) {
      bar.update();
    }
    // ... the program
  }
  return 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants