22 #ifndef NDN_UTIL_TIME_UNIT_TEST_CLOCK_HPP 23 #define NDN_UTIL_TIME_UNIT_TEST_CLOCK_HPP 36 template<
class BaseClock>
43 return nanoseconds::zero();
60 return seconds(1415684132);
72 template<
class BaseClock,
class ClockTraits = UnitTestClockTraits<BaseClock>>
77 UnitTestClock(nanoseconds startTime = ClockTraits::getDefaultStartTime());
83 advance(nanoseconds duration);
89 setNow(nanoseconds timeSinceEpoch);
93 getSince()
const override;
95 typename BaseClock::time_point
96 getNow()
const override;
98 typename BaseClock::duration
99 toWaitDuration(
typename BaseClock::duration d)
const override;
102 nanoseconds m_currentTime;
114 #endif // NDN_UTIL_TIME_UNIT_TEST_CLOCK_HPP
Class implementing custom system or steady clock behavior.
Clock that can be used in unit tests for time-dependent tests independent of wall clock...
static nanoseconds getDefaultStartTime()
static nanoseconds getDefaultStartTime()
Traits for UnitTestClock, defining default behavior for different clocks.