Changeset 2160


Ignore:
Timestamp:
6/13/2010 2:09:53 AM (5 years ago)
Author:
lowjoel
Message:

Fix the calculation interval expansion/contraction:

  • a geometric growth of the amount of time between samples would take too long to get an accurate reading, grow by 30% each time
  • reduction by subtracting 3 must only be done if we have sufficient time, otherwise we must maintain the 3-second interval
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.Util/ProgressManager.cs

    r2152 r2160  
    500500 
    501501                //If the progress delta is zero, it usually means that the amount 
    502                 //completed within the calculatin interval is too short -- lengthen 
     502                //completed within the calculation interval is too short -- lengthen 
    503503                //the interval so we can get a small difference, significant to make 
    504504                //a speed calculation. Likewise, if it is too great a difference, 
    505505                //we need to shorten the interval to get more accurate calculations 
    506506                if (progressDelta == 0.0) 
    507                     SpeedCalcInterval *= 2; 
    508                 else if (progressDelta > 3.0) 
     507                    SpeedCalcInterval += SpeedCalcInterval / 3; 
     508                else if (progressDelta > 0.01 && SpeedCalcInterval > 6) 
    509509                    SpeedCalcInterval -= 3; 
    510510 
Note: See TracChangeset for help on using the changeset viewer.