Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
Sandals::TicToc Class Reference

Class container for a timer. More...

#include <TicToc.hxx>

Public Member Functions

 TicToc (const TicToc &)=delete
 
TicTocoperator= (TicToc const &)=delete
 
 TicToc ()
 
void tic ()
 
void toc ()
 
Real elapsed_s () const
 
Real elapsed_ms () const
 
Real elapsed_us () const
 

Private Types

using Clock = std::chrono::high_resolution_clock
 
using Time = std::chrono::microseconds
 

Private Attributes

Clock::time_point m_start_time
 
Clock::time_point m_stop_time
 
Time m_elapsed_time
 

Detailed Description

Class container for a timer that uses the C++ standard library chrono to measure the elapsed time between two points in the code.

Member Typedef Documentation

◆ Clock

using Sandals::TicToc::Clock = std::chrono::high_resolution_clock
private

Clock type.

◆ Time

using Sandals::TicToc::Time = std::chrono::microseconds
private

Time type.

Constructor & Destructor Documentation

◆ TicToc() [1/2]

Sandals::TicToc::TicToc ( const TicToc & )
delete

Copy constructor for the timer.

◆ TicToc() [2/2]

Sandals::TicToc::TicToc ( )
inline

Class constructor for the timer.

Member Function Documentation

◆ elapsed_ms()

Real Sandals::TicToc::elapsed_ms ( ) const
inline

Get the elapsed time in milliseconds.

Returns
The elapsed time in milliseconds.

◆ elapsed_s()

Real Sandals::TicToc::elapsed_s ( ) const
inline

Get the elapsed time in seconds.

Returns
The elapsed time in seconds.

◆ elapsed_us()

Real Sandals::TicToc::elapsed_us ( ) const
inline

Get the elapsed time in microseconds.

Returns
The elapsed time in microseconds.

◆ operator=()

TicToc & Sandals::TicToc::operator= ( TicToc const & )
delete

Assignment operator for the timer.

◆ tic()

void Sandals::TicToc::tic ( )
inline

Start the timer.

◆ toc()

void Sandals::TicToc::toc ( )
inline

Stop the timer.

Member Data Documentation

◆ m_elapsed_time

Time Sandals::TicToc::m_elapsed_time
private

Elapsed time.

◆ m_start_time

Clock::time_point Sandals::TicToc::m_start_time
private

Start time.

◆ m_stop_time

Clock::time_point Sandals::TicToc::m_stop_time
private

Stop time.


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