|
libecs-cpp 2.1.0
Entity Component System library in C++
|
A clock that only moves when told to, for tests. More...
#include <Clock.hpp>


Public Member Functions | |
| ManualClock (std::chrono::microseconds start=std::chrono::microseconds(0)) | |
| Creates a clock that reads the given time, zero by default. | |
| std::chrono::microseconds | Now () const override |
| Time since the clock's starting point, in microseconds. | |
| void | Advance (std::chrono::microseconds delta) |
| Moves time forward. | |
| void | Set (std::chrono::microseconds value) |
| Sets the time. | |
Public Member Functions inherited from ecs::Clock | |
| virtual | ~Clock ()=default |
| Destroys the clock. | |
A clock that only moves when told to, for tests.
Safe to read and move from any thread. A container that has its own thread sleeps on the real clock between passes, so use a ManualClock with containers that are driven by calls to Container::Update().
|
inlineexplicit |
Creates a clock that reads the given time, zero by default.
|
inline |
Moves time forward.
A negative amount throws std::runtime_error and changes nothing.
|
inlineoverridevirtual |
|
inline |
Sets the time.
The caller keeps it from going backwards.