From: guido Date: Wed, 16 Feb 2000 05:30:03 +0000 (+0000) Subject: ignore start_time bug removed X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d09c0083f86d6ecb4f00386b289eeaea672225c;p=dealii-svn.git ignore start_time bug removed git-svn-id: https://svn.dealii.org/trunk@2410 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/source/timer.cc b/deal.II/base/source/timer.cc index 7163cc23b4..244633abe5 100644 --- a/deal.II/base/source/timer.cc +++ b/deal.II/base/source/timer.cc @@ -30,13 +30,16 @@ void Timer::start () double Timer::stop () { - running = false; - rusage usage; - getrusage (RUSAGE_SELF, &usage); - const double dtime = usage.ru_utime.tv_sec + 1.e-6 * usage.ru_utime.tv_usec; - cumulative_time += dtime; + if (running) + { + running = false; + rusage usage; + getrusage (RUSAGE_SELF, &usage); + const double dtime = usage.ru_utime.tv_sec + 1.e-6 * usage.ru_utime.tv_usec; + cumulative_time += dtime - start_time; + } return full_time (); -}; +} @@ -52,7 +55,7 @@ double Timer::operator() () const } else return full_time(); -}; +} @@ -60,13 +63,11 @@ void Timer::reset () { cumulative_time = 0.; running = false; -}; +} double Timer::full_time () const { return cumulative_time; -}; - - +}