From fda214ed6375171626561df81e60e76615baaff9 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 6 Feb 2009 04:49:45 +0000 Subject: [PATCH] Make sure now has a value before assigning it to last_print in ScanProgressMeter::printStats. I messed this up in r11985. Brandon reported the problem. --- timing.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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;