|
cat3d
A tiny OpenGL 3D engine library written in and for C++.
|
5 namespace cat3d::util {
82 time(
unsigned long ms);
115 std::chrono::time_point<std::chrono::steady_clock> m_start;
bool operator<=(const time &other)
Check if one duration is smaller than or equal to another.
unsigned long as_milliseconds() const
Convert this time duration into milliseconds.
static time seconds(float s)
Create a new time duration given seconds.
bool operator!=(const time &other)
Check if two durations aren't exactly equal.
Class to measure the passage of time.
Definition: clock.hpp:92
time()
By default, initializes to length 0.
static time minutes(float m)
Create a new time duration, given minutes.
time restart()
Restart the clock.
time operator-(const time &other)
Subtract two time durations.
time operator+(const time &other)
Add two times together.
float as_seconds() const
Convert this time duration into seconds.
bool operator>(const time &other)
Check if one duration is larger than another.
Class representing a duration of time.
Definition: clock.hpp:11
static time milliseconds(unsigned long ms)
Create a new time duration, given milliseconds.
bool operator<(const time &other)
Check if one duration is smaller than another.
bool operator>=(const time &other)
Check if one duration is greater than or equal to another.
time & operator+=(const time &other)
Add one duration to this.
time & operator-=(const time &other)
Subtract a duration of time from this.
float as_minutes() const
Convert this time duration into minutes.
bool operator==(const time &other)
Check if two durations are exactly equal.
time elapsed() const
Get the elapsed time since the last restart()