Timer class used to do x after y time.
More...
#include <st-timer.h>
|
| void | Start () |
| | Start the timer.
|
| void | Stop () |
| | Stop the timer.
|
| void | Reset () |
| | Reset timer. Basically set it back to 0.
|
| double | ElapsedSeconds () const |
| | Get the time the timer runs for.
|
| bool | IsRunning () const |
| | Check if the timer is running or not.
|
| void | StartLimited (double a_seconds) |
| | Start a time for a limited amount of time.
|
| bool | IsExpired () |
| | Check if a limited timer has ran out or not.
|
| double | RemainingSeconds () const |
| | Get the remaining seconds a limited timer runs for.
|
Timer class used to do x after y time.
- Example
if (timer.Elapsed() >= 5.0) {
}
Timer class used to do x after y time.
Definition st-timer.h:15
void Start()
Start the timer.
Definition st-timer.h:19
◆ ElapsedSeconds()
| double StyyxUtil::TimerUtil::ElapsedSeconds |
( |
| ) |
const |
|
inlinenodiscard |
Get the time the timer runs for.
- Returns
- double for the elapsed seconds
◆ IsExpired()
| bool StyyxUtil::TimerUtil::IsExpired |
( |
| ) |
|
|
inline |
Check if a limited timer has ran out or not.
- Returns
- true if the limited timer is run out
◆ IsRunning()
| bool StyyxUtil::TimerUtil::IsRunning |
( |
| ) |
const |
|
inlinenodiscard |
Check if the timer is running or not.
- Returns
- bool true if the timer is running
◆ RemainingSeconds()
| double StyyxUtil::TimerUtil::RemainingSeconds |
( |
| ) |
const |
|
inlinenodiscard |
Get the remaining seconds a limited timer runs for.
- Returns
- double for the remaining seconds a limited timer has left
◆ Reset()
| void StyyxUtil::TimerUtil::Reset |
( |
| ) |
|
|
inline |
Reset timer. Basically set it back to 0.
◆ Start()
| void StyyxUtil::TimerUtil::Start |
( |
| ) |
|
|
inline |
◆ StartLimited()
| void StyyxUtil::TimerUtil::StartLimited |
( |
double | a_seconds | ) |
|
|
inline |
Start a time for a limited amount of time.
- Parameters
-
| a_seconds | amount of time the timer will run for |
◆ Stop()
| void StyyxUtil::TimerUtil::Stop |
( |
| ) |
|
|
inline |
◆ limited
| bool StyyxUtil::TimerUtil::limited { false } |
|
private |
◆ limitSeconds
| double StyyxUtil::TimerUtil::limitSeconds {0.0} |
|
private |
◆ running
| bool StyyxUtil::TimerUtil::running {false} |
|
private |
◆ startTime
| std::chrono::steady_clock::time_point StyyxUtil::TimerUtil::startTime {} |
|
private |
The documentation for this struct was generated from the following file: