15 #ifndef __NET_TIME_H__
16 #define __NET_TIME_H__
27 template <
typename Duration>
29 std::chrono::time_point<std::chrono::system_clock, Duration>;
40 constexpr
NET_Time() : myUS(std::chrono::microseconds(0)) {}
44 return myUS ==
Timestamp(std::chrono::microseconds(0));
51 return Timestamp(std::chrono::microseconds(0));
58 return myUS == time.myUS;
62 return myUS != time.myUS;
66 return myUS < time.myUS;
70 return myUS > time.myUS;
74 return myUS <= time.myUS;
78 return myUS >= time.myUS;
84 std::chrono::microseconds us = t.
timestamp() - myUS;
85 T dur = std::chrono::duration_cast<
T>(us);
90 static NET_Time fromDeltaSinceWindowsEpoch(std::chrono::microseconds
t);
92 std::chrono::microseconds toDeltaSinceWindowsEpoch()
const;
94 time_t toTimeT()
const;
96 template <
typename Duration>
106 static bool fromUTCStringToLocal(
const UT_StringRef &time_string,
121 const NET_Time &
t,
const std::chrono::microseconds &us)
123 std::chrono::microseconds diff = t.
timestamp() - myUS;
127 #endif // __NET_TIME_H__
bool hasElapsed(const NET_Time &t, const T &elapse)
constexpr bool operator!=(const NET_Time &time) const
GT_API const UT_StringHolder time
constexpr bool operator>=(const NET_Time &time) const
static constexpr Timestamp maxT()
constexpr bool isNull() const
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
constexpr bool isMax() const
static NET_Time fromTimestamp(const NET_TimePoint< Duration > &tp)
std::chrono::time_point< std::chrono::system_clock, Duration > NET_TimePoint
std::chrono::time_point< std::chrono::system_clock > Timestamp
NET_TimePoint< std::chrono::microseconds > Timestamp
const Timestamp & timestamp() const
constexpr bool operator==(const NET_Time &time) const
constexpr bool operator>(const NET_Time &time) const
constexpr bool operator<(const NET_Time &time) const
constexpr bool operator<=(const NET_Time &time) const
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
static constexpr Timestamp minT()
constexpr bool isMin() const