10 #ifndef LLVM_SUPPORT_CHRONO_H
11 #define LLVM_SUPPORT_CHRONO_H
32 template <
typename D = std::chrono::nanoseconds>
33 using TimePoint = std::chrono::time_point<std::chrono::system_clock, D>;
37 using namespace std::chrono;
38 return system_clock::to_time_t(
39 time_point_cast<system_clock::time_point::duration>(TP));
45 using namespace std::chrono;
46 return time_point_cast<seconds>(system_clock::from_time_t(T));
51 raw_ostream &operator<<(raw_ostream &OS, sys::TimePoint<> TP);
55 #endif // LLVM_SUPPORT_CHRONO_H
LLVM_ATTRIBUTE_ALWAYS_INLINE std::time_t toTimeT(TimePoint<> TP)
Convert a TimePoint to std::time_t.
LLVM_ATTRIBUTE_ALWAYS_INLINE TimePoint< std::chrono::seconds > toTimePoint(std::time_t T)
Convert a std::time_t to a TimePoint.
#define LLVM_ATTRIBUTE_ALWAYS_INLINE
LLVM_ATTRIBUTE_ALWAYS_INLINE - On compilers where we have a directive to do so, mark a method "always...
std::chrono::time_point< std::chrono::system_clock, D > TimePoint
A time point on the system clock.