Google OR-Tools: ortools/util/time_limit.cc Source File
23#include "absl/flags/flag.h"
24#include "absl/log/die_if_null.h"
26#include "absl/strings/str_cat.h"
29ABSL_FLAG(bool, time_limit_use_usertime, false,
30 "If true, rely on the user time in the TimeLimit class. This is "
31 "only recommended for benchmarking on a non-isolated environment.");
47 std::string buffer = absl::StrCat(
53 for (const auto& counter : deterministic_counters_) {
54 const std::string& counter_name = counter.first;
55 const double counter_value = counter.second;
56 absl::StrAppend(&buffer, "\n", counter_name, ": ", (counter_value));
64 double deterministic_limit)
65 : base_time_limit_(ABSL_DIE_IF_NULL(base_time_limit)),
66 time_limit_(std::min(base_time_limit_->GetTimeLeft(), limit_in_seconds),
67 std::min(base_time_limit_->GetDeterministicTimeLeft(),
69 if (base_time_limit_->external_boolean_as_limit_ != nullptr) {
70 time_limit_.RegisterExternalBooleanAsLimit(
~NestedTimeLimit()
Definition time_limit.cc:75
NestedTimeLimit(TimeLimit *base_time_limit, double limit_in_seconds, double deterministic_limit)
Definition time_limit.cc:62
double GetTimeLeft() const
double GetElapsedDeterministicTime() const
double GetDeterministicTimeLeft() const
static const int kHistorySize
static const double kSafetyBufferSeconds
double GetElapsedTime() const
std::string DebugString() const
Definition time_limit.cc:46
ABSL_FLAG(bool, time_limit_use_usertime, false, "If true, rely on the user time in the TimeLimit class. This is " "only recommended for benchmarking on a non-isolated environment.")