This repository has been archived on 2025-06-01. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
compLIB/server_v2/include/Cache.hpp
2022-05-21 23:31:23 +02:00

23 lines
387 B
C++

#ifndef COMPLIB_SERVER_CACHE_HPP
#define COMPLIB_SERVER_CACHE_HPP
#include <chrono>
class Cache {
public:
explicit Cache(int rate_hz);
bool is_expired();
void update();
private:
typedef std::chrono::steady_clock clock;
std::chrono::microseconds cache_duration{};
std::chrono::time_point<std::chrono::steady_clock> last_update{};
};
#endif //COMPLIB_SERVER_CACHE_HPP