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

Class container for a timer. More...

#include <TicToc.hh>

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

template<typename Real>
class Sandals::TicToc< Real >

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

template<typename Real>
using Sandals::TicToc< Real >::Clock = std::chrono::high_resolution_clock
private

Clock type.

◆ Time

template<typename Real>
using Sandals::TicToc< Real >::Time = std::chrono::microseconds
private

Time type.

Constructor & Destructor Documentation

◆ TicToc() [1/2]

template<typename Real>
Sandals::TicToc< Real >::TicToc ( const TicToc< Real > & )
delete

Copy constructor for the timer.

◆ TicToc() [2/2]

template<typename Real>
Sandals::TicToc< Real >::TicToc ( )
inline

Class constructor for the timer.

Member Function Documentation

◆ elapsed_ms()

template<typename Real>
Real Sandals::TicToc< Real >::elapsed_ms ( ) const
inline

Get the elapsed time in milliseconds.

Returns
The elapsed time in milliseconds.

◆ elapsed_s()

template<typename Real>
Real Sandals::TicToc< Real >::elapsed_s ( ) const
inline

Get the elapsed time in seconds.

Returns
The elapsed time in seconds.

◆ elapsed_us()

template<typename Real>
Real Sandals::TicToc< Real >::elapsed_us ( ) const
inline

Get the elapsed time in microseconds.

Returns
The elapsed time in microseconds.

◆ operator=()

template<typename Real>
TicToc & Sandals::TicToc< Real >::operator= ( TicToc< Real > const & )
delete

Assignment operator for the timer.

◆ tic()

template<typename Real>
void Sandals::TicToc< Real >::tic ( )
inline

Start the timer.

◆ toc()

template<typename Real>
void Sandals::TicToc< Real >::toc ( )
inline

Stop the timer.

Member Data Documentation

◆ m_elapsed_time

template<typename Real>
Time Sandals::TicToc< Real >::m_elapsed_time
private

Elapsed time.

◆ m_start_time

template<typename Real>
Clock::time_point Sandals::TicToc< Real >::m_start_time
private

Start time.

◆ m_stop_time

template<typename Real>
Clock::time_point Sandals::TicToc< Real >::m_stop_time
private

Stop time.


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