Definition at line 48 of file gnc-autoclear.cpp.
◆ RuntimeMonitor()
| RuntimeMonitor::RuntimeMonitor |
( |
double |
seconds | ) |
|
|
inline |
Definition at line 53 of file gnc-autoclear.cpp.
53 : m_start(std::chrono::steady_clock::now())
54 {
55 if (seconds > 0) m_seconds = seconds;
56 };
◆ get_elapsed()
| double RuntimeMonitor::get_elapsed |
( |
| ) |
|
|
inline |
Definition at line 57 of file gnc-autoclear.cpp.
58 {
59 return std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::steady_clock::now() - m_start).count();
60 }
◆ should_abort()
| bool RuntimeMonitor::should_abort |
( |
| ) |
|
|
inline |
Definition at line 61 of file gnc-autoclear.cpp.
62 {
63 if (!m_seconds.has_value()) return false;
64 if (++m_counter % 100000 != 0) return false;
65 return get_elapsed() > *m_seconds;
66 }
◆ m_counter
| uint64_t RuntimeMonitor::m_counter = 0 |
◆ m_seconds
| std::optional<double> RuntimeMonitor::m_seconds |
◆ m_start
| std::chrono::steady_clock::time_point RuntimeMonitor::m_start |
The documentation for this struct was generated from the following file: