Differences From Artifact [813833df71]:
- File utils/ofhttp/ProgressBar.m — part of check-in [8a0c5ed345] at 2020-04-13 15:48:54 on branch trunk — OFLocale: Allow plural scripting in fallback (user: js, size: 7020) [annotate] [blame] [check-ins using] [more...]
To Artifact [530e773cf6]:
- File
utils/ofhttp/ProgressBar.m
— part of check-in
[30e8df31a0]
at
2020-08-10 20:55:21
on branch trunk
— ofhttp: Average the speed over the last 10 seconds
This avoids the speed and hence also the ETA jumping like crazy on a
flaky connection. (user: js, size: 7244) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
252 253 254 255 256 257 258 | [self _drawProgress]; else [self _drawReceived]; } - (void)calculateBPSAndETA { | > | > > > > > > > > > | 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | [self _drawProgress]; else [self _drawReceived]; } - (void)calculateBPSAndETA { _BPSWindow[_BPSWindowIndex++ % BPS_WINDOW_SIZE] = (float)(_received - _lastReceived) / -(float)_lastReceivedDate.timeIntervalSinceNow; if (_BPSWindowLength < BPS_WINDOW_SIZE) _BPSWindowLength++; _BPS = 0; for (size_t i = 0; i < _BPSWindowLength; i++) _BPS += _BPSWindow[i]; _BPS /= _BPSWindowLength; _ETA = (double)(_length - _received) / _BPS; _lastReceived = _received; [_lastReceivedDate release]; _lastReceivedDate = [[OFDate alloc] init]; } |
︙ | ︙ |