MXL : Media eXchange Layer
MXL
Loading...
Searching...
No Matches
Time.hpp File Reference
#include <ctime>
Include dependency graph for Time.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool operator!= (timespec const &lhs, timespec const &rhs)
bool operator< (timespec const &lhs, timespec const &rhs)
bool operator<= (timespec const &lhs, timespec const &rhs)
bool operator== (timespec const &lhs, timespec const &rhs)
bool operator> (timespec const &lhs, timespec const &rhs)
bool operator>= (timespec const &lhs, timespec const &rhs)

Function Documentation

◆ operator!=()

bool operator!= ( timespec const & lhs,
timespec const & rhs )

Definition at line 12 of file Time.cpp.

13{
14 return !(lhs == rhs);
15}

◆ operator<()

bool operator< ( timespec const & lhs,
timespec const & rhs )

Definition at line 17 of file Time.cpp.

18{
19 if (lhs.tv_sec < rhs.tv_sec)
20 {
21 return true;
22 }
23 if (lhs.tv_sec > rhs.tv_sec)
24 {
25 return false;
26 }
27 return lhs.tv_nsec < rhs.tv_nsec;
28}

◆ operator<=()

bool operator<= ( timespec const & lhs,
timespec const & rhs )

Definition at line 30 of file Time.cpp.

31{
32 return (lhs < rhs) || (lhs == rhs);
33}

◆ operator==()

bool operator== ( timespec const & lhs,
timespec const & rhs )

Definition at line 7 of file Time.cpp.

8{
9 return (lhs.tv_sec == rhs.tv_sec) && (lhs.tv_nsec == rhs.tv_nsec);
10}

◆ operator>()

bool operator> ( timespec const & lhs,
timespec const & rhs )

Definition at line 35 of file Time.cpp.

36{
37 return !(lhs <= rhs);
38}

◆ operator>=()

bool operator>= ( timespec const & lhs,
timespec const & rhs )

Definition at line 40 of file Time.cpp.

41{
42 return !(lhs < rhs);
43}