17 #ifndef KUDU_UTIL_MONOTIME_H 18 #define KUDU_UTIL_MONOTIME_H 26 #ifdef KUDU_HEADERS_NO_STUBS 27 #include <gtest/gtest_prod.h> 29 #include "kudu/gutil/port.h" 33 #include "kudu/client/stubs.h" 36 #include "kudu/util/kudu_export.h" 56 static MonoDelta FromSeconds(
double seconds);
57 static MonoDelta FromMilliseconds(int64_t ms);
58 static MonoDelta FromMicroseconds(int64_t us);
59 static MonoDelta FromNanoseconds(int64_t ns);
69 bool Initialized()
const;
77 bool LessThan(
const MonoDelta &rhs)
const;
85 bool MoreThan(
const MonoDelta &rhs)
const;
97 std::string ToString()
const;
104 double ToSeconds()
const;
105 int64_t ToMilliseconds()
const;
106 int64_t ToMicroseconds()
const;
107 int64_t ToNanoseconds()
const;
115 void ToTimeVal(
struct timeval *tv)
const;
122 void ToTimeSpec(
struct timespec *ts)
const;
130 static void NanosToTimeSpec(int64_t nanos,
struct timespec* ts);
133 static const int64_t kUninitialized;
136 FRIEND_TEST(TestMonoTime, TestDeltaConversions);
154 static const int64_t kNanosecondsPerSecond = 1000000000L;
155 static const int64_t kNanosecondsPerMillisecond = 1000000L;
156 static const int64_t kNanosecondsPerMicrosecond = 1000L;
158 static const int64_t kMicrosecondsPerSecond = 1000000L;
180 ATTRIBUTE_DEPRECATED(
"use std::min() instead");
187 bool Initialized()
const;
211 bool ComesBefore(
const MonoTime &rhs)
const;
214 std::string ToString()
const;
222 bool Equals(
const MonoTime& other)
const;
244 FRIEND_TEST(TestMonoTime, TestTimeSpec);
245 FRIEND_TEST(TestMonoTime, TestDeltaConversions);
247 explicit MonoTime(
const struct timespec &ts);
249 double ToSeconds()
const;
263 void KUDU_EXPORT SleepFor(
const MonoDelta& delta);
Definition: callbacks.h:28
Representation of a particular point in time.
Definition: monotime.h:149
A representation of a time interval.
Definition: monotime.h:46