You are viewing a single thread.
View all comments
24 points

Apparently it’s really hard to get a progress bar right. It’s just kinda guessing, but some can be worse than others if coded carelessly, from what I’m reading.

permalink
report
reply
27 points
6 points

Ahaha

permalink
report
parent
reply
24 points

While it’s true that’s a progess bar is guessing (since it doesn’t know what would take more time in your computer). It should still finish when at 100%

permalink
report
parent
reply
20 points

This. The guessing part comes from the time it takes to do the tasks, but you know the number of tasks. So a progress bar should only reach 100% when all the tasks are completed.

For example, you might have a big process that performs 3 other small tasks and then finishes. You could reasonably assume that each small task is 33% of the big process, so after the first finishes you get 33% progress, then 66% after the second and 100% after the third. When the bar reaches 100%, the third task has finished, so your process has finished too.

What you don’t know is how much time each small task takes, so if the first task needs 20 seconds and the following tasks take just 5, you’ll spend 2/3 of the time on the first 33% of the progress bar, and then the remaining 66% gets done in 1/3 of the time.

permalink
report
parent
reply
2 points

IDK how I missed that :)

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 4.3K

    Monthly active users

  • 943

    Posts

  • 10K

    Comments

Community moderators