RAII-style object that outputs timing information to logs.
More...
#include <timer.h>
|
| Timer (std::string prefix, std::string end_msg, BCLog::LogFlags log_category=BCLog::LogFlags::ALL, bool msg_on_completion=true) |
| If log_category is left as the default, end_msg will log unconditionally (instead of being filtered by category). More...
|
|
| ~Timer () |
|
void | Log (const std::string &msg) |
|
std::string | LogMsg (const std::string &msg) |
|
|
std::optional< std::chrono::steady_clock::time_point > | m_start_t {} |
|
const std::string | m_prefix |
| Log prefix; usually the name of the function this was created in. More...
|
|
const std::string | m_title |
| A descriptive message of what is being timed. More...
|
|
const BCLog::LogFlags | m_log_category |
| Forwarded on to LogPrint if specified - has the effect of only outputting the timing log when a particular debug= category is specified. More...
|
|
const bool | m_message_on_completion |
| Whether to output the message again on completion. More...
|
|
template<typename TimeType>
class BCLog::Timer< TimeType >
RAII-style object that outputs timing information to logs.
Definition at line 23 of file timer.h.
◆ Timer()
template<typename TimeType >
If log_category is left as the default, end_msg will log unconditionally (instead of being filtered by category).
Definition at line 28 of file timer.h.
◆ ~Timer()
template<typename TimeType >
◆ Log()
template<typename TimeType >
void BCLog::Timer< TimeType >::Log |
( |
const std::string & |
msg | ) |
|
|
inline |
◆ LogMsg()
template<typename TimeType >
std::string BCLog::Timer< TimeType >::LogMsg |
( |
const std::string & |
msg | ) |
|
|
inline |
◆ m_log_category
template<typename TimeType >
Forwarded on to LogPrint if specified - has the effect of only outputting the timing log when a particular debug= category is specified.
Definition at line 92 of file timer.h.
◆ m_message_on_completion
template<typename TimeType >
const bool BCLog::Timer< TimeType >::m_message_on_completion |
|
private |
Whether to output the message again on completion.
Definition at line 95 of file timer.h.
◆ m_prefix
template<typename TimeType >
Log prefix; usually the name of the function this was created in.
Definition at line 85 of file timer.h.
◆ m_start_t
template<typename TimeType >
std::optional<std::chrono::steady_clock::time_point> BCLog::Timer< TimeType >::m_start_t {} |
|
private |
◆ m_title
template<typename TimeType >
A descriptive message of what is being timed.
Definition at line 88 of file timer.h.
The documentation for this class was generated from the following file: