Lagrange
Loading...
Searching...
No Matches
VerboseTimer Class Reference

Creates a verbose timer that prints after tock(). More...

#include <lagrange/utils/timing.h>

Public Member Functions

 VerboseTimer (std::string prefix="", spdlog::logger *log=nullptr, spdlog::level::level_enum level=spdlog::level::debug)
 Constructs a new instance.
 
void tick ()
 Starts the timer.
 
double tock (const std::string name="")
 Stops the timer.
 

Detailed Description

Creates a verbose timer that prints after tock().

Constructor & Destructor Documentation

◆ VerboseTimer()

VerboseTimer ( std::string prefix = "",
spdlog::logger * log = nullptr,
spdlog::level::level_enum level = spdlog::level::debug )
inline

Constructs a new instance.

Parameters
[in]prefixPrefix name to prepend to each log message. Defaults to empty string.
[in]logOptional logger to use. Defaults to the lagrange logger.
[in]levelLog level to use. Defaults to debug.

Member Function Documentation

◆ tock()

double tock ( const std::string name = "")
inline

Stops the timer.

Parameters
[in]nameName of the message to show.
Returns
The elapsed time in seconds.

The documentation for this class was generated from the following file: