Workspace 6.21.5
Public Member Functions | List of all members
ScopedElapsedTimeLogger Class Reference

Measure and trace elapsed time during lifetime of object.

#include <Workspace/Application/scopedelapsedtimelogger.h>

Public Member Functions

 ScopedElapsedTimeLogger (const QString &text, bool outputTime=true)
 
 ~ScopedElapsedTimeLogger ()
 
double finishEarly (bool outputTime=true)
 
bool hasFinishedEarly () const
 

Constructor & Destructor Documentation

◆ ScopedElapsedTimeLogger()

ScopedElapsedTimeLogger ( const QString &  text,
bool  outputTime = true 
)
Parameters
textThe text to log along with the elapsed time. If this string contains "%1" then the time in seconds will be printed as that argument.
outputTimeif set to false this object does nothing - this allows a variable to be used to enable and disable time tracing

◆ ~ScopedElapsedTimeLogger()

Member Function Documentation

◆ finishEarly()

double finishEarly ( bool  outputTime = true)
Returns
Elapsed time in seconds

◆ hasFinishedEarly()

bool hasFinishedEarly ( ) const