summaryrefslogtreecommitdiff
path: root/absl/time/clock.cc
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2018-06-20 06:25:23 -0700
committerGravatar Shaindel Schwartz <shaindel@google.com>2018-06-20 10:15:31 -0400
commit6c7de165d1c82684359ccb630bb5f83263fa5ebc (patch)
treef271bc0005ad42773cc0140100699b8bfbaea124 /absl/time/clock.cc
parente5be80532b5d998813f9db952d2cc5401b1532df (diff)
Project import generated by Copybara.20180600
GitOrigin-RevId: d89dba27e35462d7457121b978fd79214205e686 Change-Id: I0eae80578a93a580820bc90d42e6b42faf7fde0a
Diffstat (limited to 'absl/time/clock.cc')
-rw-r--r--absl/time/clock.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/absl/time/clock.cc b/absl/time/clock.cc
index 772f8525..3b1e8739 100644
--- a/absl/time/clock.cc
+++ b/absl/time/clock.cc
@@ -34,6 +34,7 @@
#include "absl/base/thread_annotations.h"
namespace absl {
+inline namespace lts_2018_06_20 {
Time Now() {
// TODO(bww): Get a timespec instead so we don't have to divide.
int64_t n = absl::GetCurrentTimeNanos();
@@ -43,6 +44,7 @@ Time Now() {
}
return time_internal::FromUnixDuration(absl::Nanoseconds(n));
}
+} // inline namespace lts_2018_06_20
} // namespace absl
// Decide if we should use the fast GetCurrentTimeNanos() algorithm
@@ -73,9 +75,11 @@ Time Now() {
#if !ABSL_USE_CYCLECLOCK_FOR_GET_CURRENT_TIME_NANOS
namespace absl {
+inline namespace lts_2018_06_20 {
int64_t GetCurrentTimeNanos() {
return GET_CURRENT_TIME_NANOS_FROM_SYSTEM();
}
+} // inline namespace lts_2018_06_20
} // namespace absl
#else // Use the cyclecounter-based implementation below.
@@ -93,6 +97,7 @@ static int64_t stats_slow_paths;
static int64_t stats_fast_slow_paths;
namespace absl {
+inline namespace lts_2018_06_20 {
namespace time_internal {
// This is a friend wrapper around UnscaledCycleClock::Now()
// (needed to access UnscaledCycleClock).
@@ -517,10 +522,12 @@ static uint64_t UpdateLastSample(uint64_t now_cycles, uint64_t now_ns,
return estimated_base_ns;
}
+} // inline namespace lts_2018_06_20
} // namespace absl
#endif // ABSL_USE_CYCLECLOCK_FOR_GET_CURRENT_TIME_NANOS
namespace absl {
+inline namespace lts_2018_06_20 {
namespace {
// Returns the maximum duration that SleepOnce() can sleep for.
@@ -548,6 +555,7 @@ void SleepOnce(absl::Duration to_sleep) {
}
} // namespace
+} // inline namespace lts_2018_06_20
} // namespace absl
extern "C" {