mirror of
https://github.com/TokTok/c-toxcore
synced 2026-05-26 09:44:41 +00:00
9c22e79cc8
Introduces a new testing support library 'testing/support' that provides a clean, modular, and fully deterministic environment for testing toxcore components.
29 lines
577 B
C++
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
|