title: How to interpolate progress based on discrete steps?
body: <p>In a web app some task takes multiple sequential ajax call steps to complete. Each takes 12–18 seconds.</p>
  
  <p>I want to present user a progress indicator that is making frequent little steps instead.</p>
  
  <p>My first bet was to assume a linear <code>progress = k * time</code> function, self-adjusting the <code>k</code> on each new response. <a href="http://jsfiddle.net/sergiks/r81zmtn5/" rel="nofollow">Fiddle emulated</a> the response times with random values in a +- 4s range.</p>
  
  <p>This approach appears wrong: in cases with a relatively long response after a serie of fast ones, progress takes a negative step to catch up with real pace.</p>
  
  <p>Feels like a function should go in "waves": faster at beginning, slowing down closer to the end to extent in case of a delayed checkpoint.</p>
  
  <p>What is the best practice for such a task?</p>