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
Tatsuhiro Tsujikawa 2011-02-08 00:16:29 +09:00
parent 3574f6bd7d
commit af4e47329b
1 changed files with 1 additions and 1 deletions

View File

@ -141,6 +141,7 @@ void DownloadEngine::run()
cp.reset(0);
while(!commands_.empty() || !routineCommands_.empty()) {
global::wallclock.reset();
calculateStatistics();
if(cp.differenceInMillis(global::wallclock) >= refreshInterval_) {
refreshInterval_ = DEFAULT_REFRESH_INTERVAL;
cp = global::wallclock;
@ -154,7 +155,6 @@ void DownloadEngine::run()
waitData();
}
noWait_ = false;
calculateStatistics();
}
onEndOfRun();
}