NimbleSM
NimbleSM is a solid mechanics simulation code for dynamic systems
Loading...
Searching...
No Matches
nimble::Timer Class Reference

#include <nimble_timer.h>

Public Member Functions

 Timer ()=default
 
 ~Timer ()=default
 
void Start (const std::string &name)
 
void Stop (const std::string &name)
 
double StopReport (const std::string &name)
 
double ElapsedTime (const std::string &name) const
 

Public Attributes

std::map< std::string, TimeKeepertimers_
 

Constructor & Destructor Documentation

◆ Timer()

nimble::Timer::Timer ( )
default

◆ ~Timer()

nimble::Timer::~Timer ( )
default

Member Function Documentation

◆ ElapsedTime()

double nimble::Timer::ElapsedTime ( const std::string & name) const
inline
139 {
140 return timers_.at(name).GetElapsedTime();
141 }
std::map< std::string, TimeKeeper > timers_
Definition nimble_timer.h:143

◆ Start()

void nimble::Timer::Start ( const std::string & name)
inline
114 {
115 TimeKeeper& time_keeper = timers_[name];
116 time_keeper.Start();
117 }

◆ Stop()

void nimble::Timer::Stop ( const std::string & name)
inline
121 {
122 TimeKeeper& time_keeper = timers_[name];
123 time_keeper.Stop();
124 }

◆ StopReport()

double nimble::Timer::StopReport ( const std::string & name)
inline
128 {
129 double t = 0.0;
130 TimeKeeper& time_keeper = timers_[name];
131 t -= time_keeper.GetElapsedTime();
132 time_keeper.Stop();
133 t += time_keeper.GetElapsedTime();
134 return t;
135 }

Member Data Documentation

◆ timers_

std::map<std::string, TimeKeeper> nimble::Timer::timers_

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