NuTo
Numerics Tool
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
NuTo::Timer Class Reference

prints the lifetime of a Timer object on destruction More...

#include <Timer.h>

Public Member Functions

 Timer (std::string rMsg, bool rShowTime=true)
 ctor, saves the current time More...
 
 Timer (std::string rMsg, bool rShowTime, Logger &rLogger)
 ctor, saves the current time More...
 
 Timer (const Timer &)=delete
 
Timeroperator= (const Timer &)=delete
 
 ~Timer ()
 dtor, prints the msg and the lifetime More...
 
void Reset ()
 
void Reset (std::string rMsg)
 
double GetTimeDifference () const
 returns the time from ctor to now in seconds More...
 

Public Attributes

std::string mMsg
 
bool mShowTime
 
LoggermLogger
 
std::chrono::time_point< std::chrono::system_clock > mWallTimeInit
 

Static Public Attributes

static constexpr int mMinOutputLength = 90
 

Detailed Description

prints the lifetime of a Timer object on destruction

Constructor & Destructor Documentation

NuTo::Timer::Timer ( std::string  rMsg,
bool  rShowTime = true 
)

ctor, saves the current time

Parameters
rMsgmsg to print on destruction
rShowTimefalse: no output
NuTo::Timer::Timer ( std::string  rMsg,
bool  rShowTime,
Logger rLogger 
)

ctor, saves the current time

Parameters
rMsgmsg to print on destruction
rShowTimefalse: no output
NuTo::Timer::Timer ( const Timer )
delete
NuTo::Timer::~Timer ( )

dtor, prints the msg and the lifetime

Member Function Documentation

double NuTo::Timer::GetTimeDifference ( ) const

returns the time from ctor to now in seconds

Timer& NuTo::Timer::operator= ( const Timer )
delete
void NuTo::Timer::Reset ( )
void NuTo::Timer::Reset ( std::string  rMsg)

Member Data Documentation

Logger* NuTo::Timer::mLogger
constexpr int NuTo::Timer::mMinOutputLength = 90
static
std::string NuTo::Timer::mMsg
bool NuTo::Timer::mShowTime
std::chrono::time_point<std::chrono::system_clock> NuTo::Timer::mWallTimeInit

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