]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: adding missing ceph::coarse_real_clock helpers
authorCasey Bodley <cbodley@redhat.com>
Tue, 14 Aug 2018 15:12:48 +0000 (11:12 -0400)
committerNathan Cutler <ncutler@suse.com>
Tue, 2 Oct 2018 17:10:50 +0000 (19:10 +0200)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 11cd4254ff645a306442f88356e8ac3d493c9a3d)

src/common/ceph_time.h

index d3d5dfa362e857b976eed8b34439d92d1bd5d8b8..33777c4c235c895d810e8f173682317b6c099534 100644 (file)
@@ -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<seconds>(t.time_since_epoch()).count();
       }