HLCC Documentation
3.0.1
Loading...
Searching...
No Matches
software
common
utils
cpp
src
include
hlcc
utils
logTimer
logTimer.hpp
Go to the documentation of this file.
1
10
11
#ifndef HLCC_COMMON_UTILS_LOGTIMER_HPP
12
#define HLCC_COMMON_UTILS_LOGTIMER_HPP
13
14
#include <functional>
15
#include <boost/asio.hpp>
16
#include <chrono>
17
#include <optional>
18
42
class
LogTimer
{
43
public
:
50
LogTimer
(uint32_t period_s);
51
58
std::optional<uint32_t>
Check
();
59
60
private
:
61
void
Tick_();
62
boost::asio::chrono::seconds m_period_s;
63
uint32_t m_skipped_count;
64
boost::asio::io_context m_io;
65
boost::asio::steady_timer m_timer;
66
67
// Always log message for the first time
68
bool
m_ready =
true
;
69
};
70
71
#endif
// HLCC_COMMON_UTILS_LOGTIMER_HPP
LogTimer::LogTimer
LogTimer(uint32_t period_s)
Definition
logTimer.cpp:14
LogTimer::Check
std::optional< uint32_t > Check()
Definition
logTimer.cpp:21
Generated by
1.13.2