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

Output not updating until function end #88

Closed
AntMooreWebDev opened this issue Aug 13, 2021 · 0 comments
Closed

Output not updating until function end #88

AntMooreWebDev opened this issue Aug 13, 2021 · 0 comments

Comments

@AntMooreWebDev
Copy link

I'm getting an issue where the console interface is not being updated until the function ends, or I call Thread.Sleep()

const int totalTicks = 10;
var options = new ProgressBarOptions
{
    ProgressCharacter = '─',
    ProgressBarOnBottom = true,
};
using (var pbar = new ProgressBar(totalTicks, "Initial message", options))
{
    pbar.Tick(); //will advance pbar to 1 out of 10.
                    //we can also advance and update the progressbar text
    pbar.Tick("Step 2 of 10");
    pbar.Tick("Step 3 of 10");
    Thread.Sleep(1000);
    pbar.Tick("Step 4 of 10");
    pbar.Tick("Step 5 of 10");
    Thread.Sleep(1000);
    pbar.Tick("Step 6 of 10");
    pbar.Tick("Step 7 of 10");
    pbar.Tick("Step 8 of 10");
    Thread.Sleep(1000);
    pbar.Tick("Step 9 of 10");
    pbar.Tick("Step 10 of 10");
}

When running the application with, or without breakpoints, the interface is only updated after Thread.Sleep(), or once the function returns..

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

1 participant