9 #ifndef LIBPMEMOBJ_CPP_CONVERSIONS_HPP
10 #define LIBPMEMOBJ_CPP_CONVERSIONS_HPP
28 template <
typename Clock,
typename Duration =
typename Clock::duration>
33 auto rel_duration = timepoint.time_since_epoch();
35 std::chrono::duration_cast<std::chrono::seconds>(rel_duration);
37 ts.tv_sec = sec.count();
38 ts.tv_nsec =
static_cast<long>(
39 std::chrono::duration_cast<std::chrono::nanoseconds>(
timespec timepoint_to_timespec(const std::chrono::time_point< Clock, Duration > &timepoint)
Convert std::chrono::time_point to posix timespec.
Definition: conversions.hpp:30
Persistent memory namespace.
Definition: allocation_flag.hpp:15