From 4ad6b9c3afae498f67c219288a1a73e650109045 Mon Sep 17 00:00:00 2001 From: Tim King Date: Thu, 8 Feb 2018 08:59:05 -0800 Subject: [PATCH] Initializing Timer::d_wall_limit (CID 1362899). (#1573) --- src/util/resource_manager.h | 41 +++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/util/resource_manager.h b/src/util/resource_manager.h index c84bed38d..7af10ba36 100644 --- a/src/util/resource_manager.h +++ b/src/util/resource_manager.h @@ -34,28 +34,17 @@ namespace CVC4 { * the PropEngine when the budget expires. */ class CVC4_PUBLIC Timer { - - uint64_t d_ms; - timeval d_wall_limit; - clock_t d_cpu_start_time; - clock_t d_cpu_limit; - - bool d_wall_time; - - /** Return the milliseconds elapsed since last set() cpu time. */ - uint64_t elapsedCPU() const; - /** Return the milliseconds elapsed since last set() wall time. */ - uint64_t elapsedWall() const; - -public: - + public: /** Construct a Timer. */ Timer() - : d_ms(0) - , d_cpu_start_time(0) - , d_cpu_limit(0) - , d_wall_time(true) - {} + : d_ms(0), + d_cpu_start_time(0), + d_cpu_limit(0), + d_wall_time(true) + { + d_wall_limit.tv_sec = 0; + d_wall_limit.tv_usec = 0; + } /** Is the timer currently active? */ bool on() const { @@ -69,6 +58,18 @@ public: uint64_t elapsed() const; bool expired() const; + private: + + /** Return the milliseconds elapsed since last set() cpu time. */ + uint64_t elapsedCPU() const; + /** Return the milliseconds elapsed since last set() wall time. */ + uint64_t elapsedWall() const; + + uint64_t d_ms; + clock_t d_cpu_start_time; + clock_t d_cpu_limit; + bool d_wall_time; + timeval d_wall_limit; };/* class Timer */ -- 2.30.2