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;
100 static bool fromUTCStringToLocal(
const UT_StringRef &time_string,
108 constexpr
NET_Time(Timestamp us) : myUS(us) {}
115 const NET_Time &
t,
const std::chrono::microseconds &us)
117 std::chrono::microseconds diff = t.
timestamp() - myUS;
121 #endif // __NET_TIME_H__
vint4 max(const vint4 &a, const vint4 &b)
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
constexpr bool isMax() const
std::chrono::time_point< std::chrono::system_clock, Duration > NET_TimePoint
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
static constexpr Timestamp minT()
vint4 min(const vint4 &a, const vint4 &b)
constexpr bool isMin() const