Roll forward to cl/338482889

Signed-off-by: Alexey Polyudov <apolyudov@google.com>
Change-Id: I9850950db8bd84f0904ea1a413151887f52098cf
This commit is contained in:
Alexey Polyudov
2020-10-22 10:47:34 -07:00
parent d68e53cf03
commit 2155b3ddeb
542 changed files with 15219 additions and 42295 deletions
+9 -8
View File
@@ -1,19 +1,20 @@
#ifndef PLATFORM_API_SYSTEM_CLOCK_H_
#define PLATFORM_API_SYSTEM_CLOCK_H_
#include <cstdint>
#include "platform/base/exception.h"
#include "absl/time/clock.h"
namespace location {
namespace nearby {
class SystemClock {
class SystemClock final {
public:
virtual ~SystemClock() {}
// Returns the time (in milliseconds) since the system was booted, and
// includes deep sleep. This clock should be guaranteed to be monotonic, and
// should continue to tick even when the CPU is in power saving modes.
virtual std::int64_t elapsedRealtime() = 0;
// Initialize global system state.
static void Init();
// Returns current absolute time. It is guaranteed to be monotonic.
static absl::Time ElapsedRealtime();
// Pauses current thread for the specified duration.
static Exception Sleep(absl::Duration duration);
};
} // namespace nearby