|
RSTools 3.1.0
Versatile C++20 utility library
|
Logs the time spent in a scope when destroyed, usually through RST_LOG_SCOPE_TIME(). More...
#include <RST/log/ScopedTimer.hpp>
Public Types | |
| using | Clock = std::chrono::steady_clock |
| using | Duration = std::chrono::milliseconds |
Public Member Functions | |
| ScopedTimer (std::string name, std::shared_ptr< Logger > logger=nullptr, Duration warnThreshold=Duration(-1), LogLevel level=LogLevel::Debug, SourceLocation source={}) | |
Starts timing; logger defaults to the default logger and a negative warnThreshold disables the warning. | |
| ~ScopedTimer () | |
| ScopedTimer (const ScopedTimer &)=delete | |
| ScopedTimer & | operator= (const ScopedTimer &)=delete |
| Duration | elapsed () const |
Logs the time spent in a scope when destroyed, usually through RST_LOG_SCOPE_TIME().
The time is logged at level, or as a [SLOW] warning once warnThreshold is reached.
| using RST::Log::ScopedTimer::Clock = std::chrono::steady_clock |
| using RST::Log::ScopedTimer::Duration = std::chrono::milliseconds |
|
inline |
Starts timing; logger defaults to the default logger and a negative warnThreshold disables the warning.
|
inline |
|
delete |
|
delete |
|
inline |