diff options
Diffstat (limited to 'softoff/timer.hpp')
-rw-r--r-- | softoff/timer.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/softoff/timer.hpp b/softoff/timer.hpp index 7c3bac2..9d597f8 100644 --- a/softoff/timer.hpp +++ b/softoff/timer.hpp @@ -38,11 +38,19 @@ class Timer } } - inline auto isExpired() + inline auto isExpired() const { return expired; } + /** @brief Starts the timer with specified expiration value. + * input is an offset from the current steady_clock + */ + int startTimer(std::chrono::microseconds usec); + + /** @brief Enables / disables the timer */ + int setTimer(int action); + private: /** @brief the sd_event structure */ sd_event* timeEvent = nullptr; @@ -76,6 +84,9 @@ class Timer */ static int timeoutHandler(sd_event_source* eventSource, uint64_t usec, void* userData); + + /** @brief Gets the current time from steady clock */ + static std::chrono::microseconds getTime(); }; } // namespace ipmi |