class gpr::WallClockLimit¶
A monotonic wall-clock deadline shared by a complete search and every nested phase. The optional clock makes deadline behaviour testable without sleeping; production uses steady_clock.
#include <gpr/ml/PhaseTimers.h>
class WallClockLimit {
public:
// typedefs
typedef std::chrono::steady_clock Clock;
typedef std::function<Clock::time_point()> Now;
// construction
WallClockLimit(double seconds, Now now = {});
// methods
bool enabled() const;
double elapsedSeconds() const;
bool reached() const;
double seconds() const;
};