Files
c-toxcore/testing/support/public/clock.hh
T
iphydf 9c22e79cc8 test(support): add SimulatedEnvironment for deterministic testing
Introduces a new testing support library 'testing/support' that provides
a clean, modular, and fully deterministic environment for testing
toxcore components.
2026-01-07 13:06:18 +00:00

29 lines
577 B
C++

#ifndef C_TOXCORE_TESTING_SUPPORT_CLOCK_H
#define C_TOXCORE_TESTING_SUPPORT_CLOCK_H
#include <cstdint>
namespace tox::test {
/**
* @brief Abstraction over the system's monotonic clock.
*/
class ClockSystem {
public:
virtual ~ClockSystem();
/**
* @brief Returns current monotonic time in milliseconds.
*/
virtual uint64_t current_time_ms() const = 0;
/**
* @brief Returns current monotonic time in seconds.
*/
virtual uint64_t current_time_s() const = 0;
};
} // namespace tox::test
#endif // C_TOXCORE_TESTING_SUPPORT_CLOCK_H