Skip to content

Commit 658d5b6

Browse files
committed
Added is_zero and is_not_zero to rak::timer.
1 parent e1d2190 commit 658d5b6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rak/timer.h

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ class timer {
4949
timer(int64_t usec = 0) : m_time(usec) {}
5050
timer(timeval tv) : m_time((int64_t)(uint32_t)tv.tv_sec * 1000000 + (int64_t)(uint32_t)tv.tv_usec % 1000000) {}
5151

52+
bool is_zero() const { return m_time == 0; }
53+
bool is_not_zero() const { return m_time != 0; }
54+
5255
int32_t seconds() const { return m_time / 1000000; }
5356
int32_t seconds_ceiling() const { return (m_time + 1000000 - 1) / 1000000; }
5457
int64_t usec() const { return m_time; }

0 commit comments

Comments
 (0)