* 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 {
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 */