9#ifndef WPIUTIL_WPI_CHRONO_H
10#define WPIUTIL_WPI_CHRONO_H
32template <
typename D = std::chrono::nanoseconds>
33using TimePoint = std::chrono::time_point<std::chrono::system_clock, D>;
37class UtcClock :
public std::chrono::system_clock {};
39template <
typename D = std::chrono::nanoseconds>
40using UtcTime = std::chrono::time_point<UtcClock, D>;
44 using namespace std::chrono;
50 using namespace std::chrono;
51 return system_clock::to_time_t(
52 time_point_cast<system_clock::time_point::duration>(TP));
57 using namespace std::chrono;
58 return system_clock::to_time_t(time_point<system_clock, seconds>(
59 duration_cast<seconds>(TP.time_since_epoch())));
65 using namespace std::chrono;
66 return time_point_cast<seconds>(system_clock::from_time_t(T));
72 using namespace std::chrono;
73 return time_point_cast<nanoseconds>(system_clock::from_time_t(T))
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:43
UtcTime< std::chrono::seconds > toUtcTime(std::time_t T)
Convert a std::time_t to a UtcTime.
Definition Chrono.h:43
std::chrono::time_point< UtcClock, D > UtcTime
Definition Chrono.h:40
TimePoint< std::chrono::seconds > toTimePoint(std::time_t T)
Convert a std::time_t to a TimePoint.
Definition Chrono.h:64
std::time_t toTimeT(TimePoint<> TP)
Convert a TimePoint to std::time_t.
Definition Chrono.h:49
std::chrono::time_point< std::chrono::system_clock, D > TimePoint
A time point on the system clock.
Definition Chrono.h:33
Foonathan namespace.
Definition ntcore_cpp.h:26
raw_ostream & operator<<(raw_ostream &OS, sys::TimePoint<> TP)