14 #ifndef OR_TOOLS_BASE_TIMER_H_ 15 #define OR_TOOLS_BASE_TIMER_H_ 17 #include "absl/time/clock.h" 18 #include "absl/time/time.h" 33 start_ = absl::GetCurrentTimeNanos();
41 sum_ += absl::GetCurrentTimeNanos() - start_;
49 return absl::Nanoseconds(
GetNanos());
55 return running_ ? absl::GetCurrentTimeNanos() - start_ + sum_ : sum_;
86 return static_cast<int64_t>(s * 1e9);
89 static int64_t
CyclesToMs(int64_t c) {
return c / 1000000; }
107 double* aggregate_time_;
114 #endif // OR_TOOLS_BASE_TIMER_H_
static double CyclesToSeconds(int64_t c)
int64_t GetCycles() const
CycleTimerBase CycleTimerInstance
ScopedWallTime(double *aggregate_time)
absl::Duration GetDuration() const
static int64_t SecondsToCycles(double s)
int64_t GetInUsec() const
static int64_t CyclesToUsec(int64_t c)
CycleTimer SimpleCycleTimer
static int64_t CyclesToMs(int64_t c)