mirror of
https://github.com/falk-werner/webfuse-provider
synced 2024-10-27 20:44:10 +00:00
27 lines
516 B
C++
27 lines
516 B
C++
#ifndef WF_TEST_TIMEOUT_WATCHER_HPP
|
|
#define WF_TEST_TIMEOUT_WATCHER_HPP
|
|
|
|
#include <chrono>
|
|
|
|
namespace webfuse_test
|
|
{
|
|
|
|
class TimeoutWatcher final
|
|
{
|
|
TimeoutWatcher(TimeoutWatcher const & other) = delete;
|
|
TimeoutWatcher& operator=(TimeoutWatcher const & other) = delete;
|
|
public:
|
|
explicit TimeoutWatcher(std::chrono::milliseconds timeout);
|
|
~TimeoutWatcher();
|
|
bool isTimeout();
|
|
void check();
|
|
private:
|
|
std::chrono::milliseconds startedAt;
|
|
std::chrono::milliseconds timeout_;
|
|
};
|
|
|
|
}
|
|
|
|
|
|
#endif
|