ManiVault 1.0.0
A Flexible and Extensible Visual Analytics Framework for High-Dimensional Data
Loading...
Searching...
No Matches
Timer Class Reference

#include <Timer.h>

Public Member Functions

 Timer (const QString &event="")
 
 ~Timer ()
 
std::int64_t elapsedTime (const SteadyClock &start) const
 
float elapsedTimeMilliseconds (const SteadyClock &start) const
 
void printElapsedTime (const QString &event, const bool &reset=false)
 
void reset ()
 

Protected Member Functions

void printTotalTime ()
 

Detailed Description

Timer utility class

Helper class for timing events When an instance of this class goes out of scope, it prints the elapsed time (prefixed by the event name)

Code inspired by: https://stackoverflow.com/questions/2808398/easily-measure-elapsed-time

Author
Thomas Kroes

Constructor & Destructor Documentation

◆ Timer()

Timer::Timer ( const QString &  event = "")

Constructor

Parameters
eventName of the event to measure (when empty, elapsed time is not printed when this object goes out of scope)

◆ ~Timer()

Timer::~Timer ( )

Destructor

Member Function Documentation

◆ elapsedTime()

std::int64_t Timer::elapsedTime ( const SteadyClock start) const

Returns the elapsed time

Parameters
startThe start time of the time interval
Returns
Elapsed time

◆ elapsedTimeMilliseconds()

float Timer::elapsedTimeMilliseconds ( const SteadyClock start) const

Returns the elapsed time

Parameters
startThe start time of the time interval
Returns
Elapsed time in milliseconds

◆ printElapsedTime()

void Timer::printElapsedTime ( const QString &  event,
const bool &  reset = false 
)

Prints the elapsed time since the timer was created

Parameters
eventName of the event
resetWhether to reset the start time

◆ printTotalTime()

void Timer::printTotalTime ( )
protected

Prints the elapsed time since the timer was created

◆ reset()

void Timer::reset ( )

Resets the start time of the timer


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