|
(Note that these are not member functions.)
|
constexpr Time | seconds (float amount) |
| Construct a time value from a number of seconds. More...
|
|
constexpr Time | milliseconds (int32_t amount) |
| Construct a time value from a number of milliseconds. More...
|
|
constexpr Time | microseconds (int64_t amount) |
| Construct a time value from a number of microseconds. More...
|
|
constexpr bool | operator== (Time rhs, Time lhs) |
| Equality operator. More...
|
|
constexpr bool | operator!= (Time rhs, Time lhs) |
| Inequality operator. More...
|
|
constexpr bool | operator< (Time rhs, Time lhs) |
| Lesser than operator. More...
|
|
constexpr bool | operator> (Time rhs, Time lhs) |
| Greater than operator. More...
|
|
constexpr bool | operator<= (Time rhs, Time lhs) |
| Lesser or equal operator. More...
|
|
constexpr bool | operator>= (Time rhs, Time lhs) |
| Greater or equal than operator. More...
|
|
constexpr Time | operator+ (Time rhs, Time lhs) |
| Addition of two times. More...
|
|
Time | operator+= (Time &rhs, Time lhs) |
| Addition and assignement. More...
|
|
constexpr Time | operator- (Time rhs, Time lhs) |
| Substraction of two times. More...
|
|
Time | operator-= (Time &rhs, Time lhs) |
| Substraction and assignment. More...
|
|
Represents a time value.
gf::Time encapsulates a time value in a flexible way. It allows to define a time value either as a number of seconds, milliseconds or microseconds. It also works the other way round: you can read a time value as either a number of seconds, milliseconds or microseconds.
By using such a flexible interface, the API doesn't impose any fixed type or resolution for time values, and let the user choose its own favorite representation.
Since they represent a time span and not an absolute time value, times can also be negative.
gf::Time is a thin wrapper around C++11 std::chrono::steady_clock.
Usage example:
gf::Time t3 = gf::microseconds(-800000);
Represents a time value.
Definition: Time.h:65
constexpr int32_t asMilliseconds() const
Return the time value as a number of milliseconds.
Definition: Time.h:107
constexpr float asSeconds() const
Return the time value as a number of seconds.
Definition: Time.h:96
constexpr int64_t asMicroseconds() const
Return the time value as a number of microseconds.
Definition: Time.h:118
- See also
- gf::Clock