Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
Timer Class Reference

Class that compute how long it takes for a program to be executed, and sequentially measures the time of execution of each function. More...

#include <Profiler.hpp>

Public Member Functions

 Timer (const char *name)
 Creates the Scope Timer. More...
 
 ~Timer ()
 Destroys this timer. More...
 
void Stop ()
 Stops this timer. More...
 

Private Attributes

const char * m_Name
 Name of the function to be timed. More...
 
std::chrono::time_point< std::chrono::high_resolution_clock > m_StartTimepoint
 Time when the timer starts. More...
 
bool m_Stopped
 Whether or not the timer is stoped. More...
 

Detailed Description

Class that compute how long it takes for a program to be executed, and sequentially measures the time of execution of each function.

See also

Constructor & Destructor Documentation

◆ Timer()

Timer::Timer ( const char *  name)
inline

Creates the Scope Timer.

Parameters
nameName o the function to be timed.

◆ ~Timer()

Timer::~Timer ( )
inline

Destroys this timer.

Member Function Documentation

◆ Stop()

void Timer::Stop ( )
inline

Stops this timer.

Member Data Documentation

◆ m_Name

const char* Timer::m_Name
private

Name of the function to be timed.

◆ m_StartTimepoint

std::chrono::time_point<std::chrono::high_resolution_clock> Timer::m_StartTimepoint
private

Time when the timer starts.

◆ m_Stopped

bool Timer::m_Stopped
private

Whether or not the timer is stoped.