Files
nearby/cpp/platform_v2/api/system_clock.h
T
Alexey Polyudov ae1c427b99 nearby: snapshot of cl/313536507
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
Change-Id: I8936b527079074d5c3af5531b9245063767cc4a7
2020-05-28 00:03:22 -07:00

24 lines
597 B
C++

#ifndef PLATFORM_V2_API_SYSTEM_CLOCK_H_
#define PLATFORM_V2_API_SYSTEM_CLOCK_H_
#include "platform_v2/base/exception.h"
#include "absl/time/clock.h"
namespace location {
namespace nearby {
class SystemClock final {
public:
// 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
} // namespace location
#endif // PLATFORM_V2_API_SYSTEM_CLOCK_H_