|
libecs-cpp 2.1.0
Entity Component System library in C++
|
A source of time for systems and containers. More...
#include <Clock.hpp>

Public Member Functions | |
| virtual | ~Clock ()=default |
| Destroys the clock. | |
| virtual std::chrono::microseconds | Now () const =0 |
| Time since the clock's starting point, in microseconds. | |
A source of time for systems and containers.
Now() returns the time since some fixed starting point that the clock chooses. It never decreases. Only differences between two readings of the same clock mean anything.
A system or a container holds a pointer to its clock and does not own it, so the clock must outlive whatever uses it. The default is the real steady clock (SteadyClock). A ManualClock lets a test move time by exact amounts without waiting.
|
virtualdefault |
Destroys the clock.
|
pure virtual |
Time since the clock's starting point, in microseconds.
Never decreases.
Implemented in ecs::SteadyClock, and ecs::ManualClock.