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

How to display all steps in spinner #141

Open
jazzboME opened this issue Oct 29, 2022 · 0 comments
Open

How to display all steps in spinner #141

jazzboME opened this issue Oct 29, 2022 · 0 comments

Comments

@jazzboME
Copy link

I'm trying this code:

func main() {
	bar := progressbar.NewOptions(-1,
		progressbar.OptionSetDescription("spinnertest"),
		progressbar.OptionShowIts(),
		progressbar.OptionShowCount(),
		progressbar.OptionSpinnerType(7),
	)

	for i:=0; i < 100; i++ {
		bar.Add(1)
		time.Sleep(1 * time.Second)
	}
}

And I'm expecting that each time it updates, it would move 1 step in the spinner, instead it just flops back and forth between 2 values. If I use spinners with more steps, 1 second intervals also seem to skip steps.

If I change the delay to be time.Sleep(500 * time.Millisecond) it does work and I see all 4 steps, but my proposed usage would be at 1 second intervals. On the other hand, if I go to time.Sleep(2 * time.Second) I get no change in the spinner, although in all situations the count increments correctly.

Is there somewhere I need to set the "total time lapse" of a spinner rotation?

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