From: Casey Bodley Date: Tue, 14 Aug 2018 15:12:48 +0000 (-0400) Subject: common: adding missing ceph::coarse_real_clock helpers X-Git-Tag: v12.2.9~29^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=46e3e01b43a769cd01ba7ca7b8cee47c1a6c7b9f;p=ceph.git common: adding missing ceph::coarse_real_clock helpers Signed-off-by: Casey Bodley (cherry picked from commit 11cd4254ff645a306442f88356e8ac3d493c9a3d) --- diff --git a/src/common/ceph_time.h b/src/common/ceph_time.h index d3d5dfa362e8..33777c4c235c 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(); }