27 #ifndef SRC_ENV_TIMER_IPP_ 28 #define SRC_ENV_TIMER_IPP_ 33 Timer(
double time_limit_in_sec) :
34 time_limit_in_sec_(time_limit_in_sec),
35 start_time_{std::chrono::high_resolution_clock::now()} {}
40 if (time_limit_in_sec_ > 0) {
41 std::chrono::duration<double> runtime = std::chrono::high_resolution_clock::now() - start_time_;
42 return (runtime.count() >= time_limit_in_sec_);
bool expired() const
Checks if the time limit has expired.
Timer(double time_limit_in_sec)
Constructs a timer for a given time limit.
Global namespace for GEDLIB.