We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e1d2190 commit 658d5b6Copy full SHA for 658d5b6
rak/timer.h
@@ -49,6 +49,9 @@ class timer {
49
timer(int64_t usec = 0) : m_time(usec) {}
50
timer(timeval tv) : m_time((int64_t)(uint32_t)tv.tv_sec * 1000000 + (int64_t)(uint32_t)tv.tv_usec % 1000000) {}
51
52
+ bool is_zero() const { return m_time == 0; }
53
+ bool is_not_zero() const { return m_time != 0; }
54
+
55
int32_t seconds() const { return m_time / 1000000; }
56
int32_t seconds_ceiling() const { return (m_time + 1000000 - 1) / 1000000; }
57
int64_t usec() const { return m_time; }
0 commit comments