From 46e3e01b43a769cd01ba7ca7b8cee47c1a6c7b9f Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 14 Aug 2018 11:12:48 -0400 Subject: [PATCH] common: adding missing ceph::coarse_real_clock helpers Signed-off-by: Casey Bodley (cherry picked from commit 11cd4254ff645a306442f88356e8ac3d493c9a3d) --- src/common/ceph_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/common/ceph_time.h b/src/common/ceph_time.h index d3d5dfa362e85..33777c4c235c8 100644 --- a/src/common/ceph_time.h +++ b/src/common/ceph_time.h @@ -178,6 +178,14 @@ namespace ceph { return from_timespec(ts); } + static bool is_zero(const time_point& t) { + return (t == time_point::min()); + } + + static time_point zero() { + return time_point::min(); + } + static time_t to_time_t(const time_point& t) noexcept { return duration_cast(t.time_since_epoch()).count(); } -- 2.39.5