From: Tim King Date: Thu, 8 Feb 2018 16:59:05 +0000 (-0800) Subject: Initializing Timer::d_wall_limit (CID 1362899). (#1573) X-Git-Tag: cvc5-1.0.0~5306 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4ad6b9c3afae498f67c219288a1a73e650109045;p=cvc5.git Initializing Timer::d_wall_limit (CID 1362899). (#1573) --- 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 */