22#include "absl/strings/str_cat.h"
25 "If true, rely on the user time in the TimeLimit class. This is "
26 "only recommended for benchmarking on a non-isolated environment.");
35 std::string buffer = absl::StrCat(
41 for (
const auto& counter : deterministic_counters_) {
42 const std::string& counter_name = counter.first;
43 const double counter_value = counter.second;
44 absl::StrAppend(&buffer,
"\n", counter_name,
": ", (counter_value));
51 double limit_in_seconds,
52 double deterministic_limit)
53 : base_time_limit_(ABSL_DIE_IF_NULL(base_time_limit)),
54 time_limit_(
std::
min(base_time_limit_->GetTimeLeft(), limit_in_seconds),
55 std::
min(base_time_limit_->GetDeterministicTimeLeft(),
56 deterministic_limit)) {
57 if (base_time_limit_->external_boolean_as_limit_ !=
nullptr) {
58 time_limit_.RegisterExternalBooleanAsLimit(
59 base_time_limit_->external_boolean_as_limit_);
NestedTimeLimit(TimeLimit *base_time_limit, double limit_in_seconds, double deterministic_limit)
double GetTimeLeft() const
void AdvanceDeterministicTime(double deterministic_duration)
double GetElapsedDeterministicTime() const
double GetDeterministicTimeLeft() const
static const int kHistorySize
static const double kSafetyBufferSeconds
static constants.
double GetElapsedTime() const
std::string DebugString() const
In SWIG mode, we don't want anything besides these top-level includes.
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.")