mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:47:46 +00:00
AK: Add Time::is_negative() to detect negative time values
This commit is contained in:
parent
3cbc2364a8
commit
a2a5cb0f24
2 changed files with 14 additions and 0 deletions
|
@ -164,6 +164,7 @@ public:
|
|||
[[nodiscard]] timeval to_timeval() const;
|
||||
|
||||
[[nodiscard]] bool is_zero() const { return !m_seconds && !m_nanoseconds; }
|
||||
[[nodiscard]] bool is_negative() const { return m_seconds < 0; }
|
||||
|
||||
bool operator==(const Time& other) const { return this->m_seconds == other.m_seconds && this->m_nanoseconds == other.m_nanoseconds; }
|
||||
bool operator!=(const Time& other) const { return !(*this == other); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue