]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
include/utime: add utimespan_str helper
authorSage Weil <sage@redhat.com>
Fri, 31 Aug 2018 20:40:31 +0000 (15:40 -0500)
committerSage Weil <sage@redhat.com>
Thu, 6 Sep 2018 15:28:45 +0000 (10:28 -0500)
Just like timespan_str(), but for utime_t.

Signed-off-by: Sage Weil <sage@redhat.com>
src/include/utime.h

index 61fc73f61d1796f41d47cd150ed07caf9dbed2e6..08db335e246c0f98f924efb1c5fb8a40b83df28b 100644 (file)
@@ -533,4 +533,9 @@ inline std::ostream& operator<<(std::ostream& out, const utime_t& t)
   return t.localtime(out);
 }
 
+inline std::string utimespan_str(const utime_t& age) {
+  auto age_ts = ceph::timespan(age.nsec()) + std::chrono::seconds(age.sec());
+  return timespan_str(age_ts);
+}
+
 #endif