Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7057041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:56:19+00:00 2026-05-28T03:56:19+00:00

I have an application that, while performing a background task, shows a progress bar

  • 0

I have an application that, while performing a background task, shows a progress bar with an “estimated time remaining” calculation (eg “5 seconds remaining”) and a “estimated time of completion” (eg “complete at 12:59:59”), or as I call it, the ETA.

The algorithm for calculating this ETA basically takes the “rolling average” of progress over time:
1. Each progress event gets added to a queue with the current time.
2. After a certain duration (eg. 10s), items are removed from the queue.
3. The ETA is extrapolated from the first and last items in the queue.
The source code is available if you care: ETACalculator.cs

However, there’s a jitter problem. As each progress event is added to the calculation, the ETA will be updated slightly. Let’s say that the ETA changes by only 0.1s. This small jitter easily causes the ETA to “flutter”. For example, instead of seeing a smooth progression from 5s, 4s, 3s, etc…, I see 5-5-5-4-5-4-5-4-5-4-4-4.

I was thinking of just reducing the updates to 1-per-second, but then the progress bar is less smooth, and also I’d really like “actual” slowdowns to be shown real time.

I’m having trouble coming up with a simple algorithm that reduces this jumpy jitter. How can I remove the jitter?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:56:20+00:00Added an answer on May 28, 2026 at 3:56 am

    Separate the actual jittery progress and the displayed progress into two separate variables.

    Update the jittery progress as you do now.

    At a regular (relatively quick) interval, update the displayed progress to approach the actual progress.

    A simple approach algorithm would be to average the two values

    display_progress = (display_progress + actual_progress) / 2 
    

    This will dampen the value to reflect past values and not just the immediate value.

    You can also refine the smoothness by using:

    display_progress = (P) * display_progress + (1.0-P) * actual_progress 
    

    Where P is a constant value between 0.0 and 1.0.

    Edit:

    This is one of many filters that could be used. This one is nice in that it doesn’t require much bookkeeping.

    However, getting perfect output is not going to be an option, because the flaw is in your input. The difference between “jitter” and “actual slowdowns” is only observable after it has happened.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a particular application that needs to calculate something very specific, and while
I have java application that is crashing while in production. It doesn't do so
I have an application that, as any other app, crashes once in a while
I have an GUI application that takes a while to load all its plugins,
I have an application that keeps using up more and more memory as time
I have application that makes different queries with different results so the caching in
I have application that is connecting to the DB and if I enter incorrect
I have application that is up more than 3 days. I can see in
I have application that brings response via Ajax and creates 5-20 new jQuery click
I have an application that sends messages to an external web service. I build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.