22 #ifndef NDN_CXX_UTIL_TIME_UNIT_TEST_CLOCK_HPP
23 #define NDN_CXX_UTIL_TIME_UNIT_TEST_CLOCK_HPP
36 template<
class BaseClock>
43 return nanoseconds::zero();
72 template<
class BaseClock,
class ClockTraits = UnitTestClockTraits<BaseClock>>
95 typename BaseClock::time_point
Class implementing custom system or steady clock behavior.
static nanoseconds getDefaultStartTime()
Traits for UnitTestClock, defining default behavior for different clocks.
static nanoseconds getDefaultStartTime()
Clock that can be used in unit tests for time-dependent tests independent of wall clock.
void setNow(nanoseconds timeSinceEpoch)
Explicitly set clock to timeSinceEpoch.
std::string getSince() const override
BaseClock::time_point getNow() const override
BaseClock::duration toWaitDuration(typename BaseClock::duration d) const override
void advance(nanoseconds duration)
Advance unit test clock by duration.
UnitTestClock(nanoseconds startTime=ClockTraits::getDefaultStartTime())
boost::chrono::duration< Rep, Period > duration
boost::chrono::nanoseconds nanoseconds
boost::chrono::seconds seconds