Files
nearby/cpp/platform/api/system_clock.h
T
Alexey Polyudov 2155b3ddeb Roll forward to cl/338482889
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
Change-Id: I9850950db8bd84f0904ea1a413151887f52098cf
2020-10-22 10:47:34 -07:00

24 lines
585 B
C++

#ifndef PLATFORM_API_SYSTEM_CLOCK_H_
#define PLATFORM_API_SYSTEM_CLOCK_H_
#include "platform/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_API_SYSTEM_CLOCK_H_