mirror of https://github.com/aria2/aria2
Call calculateStatistics() after global::wallclock.reset().
Inside calculateStatistics(), global::wallclock is used and if calculateStatistics() is called after waitData(), it may use quite old global::wallclock value.pull/1/head
parent
3574f6bd7d
commit
af4e47329b
|
@ -141,6 +141,7 @@ void DownloadEngine::run()
|
||||||
cp.reset(0);
|
cp.reset(0);
|
||||||
while(!commands_.empty() || !routineCommands_.empty()) {
|
while(!commands_.empty() || !routineCommands_.empty()) {
|
||||||
global::wallclock.reset();
|
global::wallclock.reset();
|
||||||
|
calculateStatistics();
|
||||||
if(cp.differenceInMillis(global::wallclock) >= refreshInterval_) {
|
if(cp.differenceInMillis(global::wallclock) >= refreshInterval_) {
|
||||||
refreshInterval_ = DEFAULT_REFRESH_INTERVAL;
|
refreshInterval_ = DEFAULT_REFRESH_INTERVAL;
|
||||||
cp = global::wallclock;
|
cp = global::wallclock;
|
||||||
|
@ -154,7 +155,6 @@ void DownloadEngine::run()
|
||||||
waitData();
|
waitData();
|
||||||
}
|
}
|
||||||
noWait_ = false;
|
noWait_ = false;
|
||||||
calculateStatistics();
|
|
||||||
}
|
}
|
||||||
onEndOfRun();
|
onEndOfRun();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue