diff --git a/timing.cc b/timing.cc index f5db9321d..99ff9ce0e 100644 --- a/timing.cc +++ b/timing.cc @@ -560,6 +560,11 @@ bool ScanProgressMeter::printStats(double perc_done, time_t timet; struct tm *ltime; + if (!now) { + gettimeofday(&tvtmp, NULL); + now = (const struct timeval *) &tvtmp; + } + last_print = *now; // If we're less than 1% done we probably don't have enough @@ -572,11 +577,6 @@ bool ScanProgressMeter::printStats(double perc_done, return true; } - if (!now) { - gettimeofday(&tvtmp, NULL); - now = (const struct timeval *) &tvtmp; - } - /* OK, now lets estimate the time to finish */ time_used_s = difftime(now->tv_sec, begin.tv_sec); time_needed_s = time_used_s / perc_done;