MockableSteadyClock

Version of SteadyClock that is mockable in the context of tests (via FakeSteadyClock, or Self::SetMockTime), otherwise the system steady clock.

Synopsis

Declared in <util/time.h>

struct MockableSteadyClock
    : std::chrono::steady_clock

Base Classes

NameDescription
std::chrono::steady_clock

Type Aliases

NameDescription
duration
mock_time_point Time point type used to store the mocked time, in milliseconds.
period
rep
time_point Time point measured against this clock.

Static Member Functions

NameDescription
ClearMockTime Clear mock time, go back to system steady clock.
SetMockTime Set mock time for testing. When mocking the steady clock, start at INITIAL_MOCK_TIME and add durations to elapse time as necessary for testing. To stop mocking, call ClearMockTime().
from_time_t [deleted]Deleted and unused conversion from std::time_t.
now Return current system time or mocked time, if set.
to_time_t [deleted]Deleted and unused conversion to std::time_t.

Static Data Members

NameDescription
INITIAL_MOCK_TIME Starting value used when mocking begins.
is_steady