Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
StopWatch< TimeT, ClockT > Class Template Reference

#include <StopWatch.h>

Public Member Functions

void add (const StopWatch< TimeT, ClockT > &other)
long long int elapsed () const
long long int getAverage () const
const std::vector< TimeT > & getHistory () const
long long int getTotal () const
void start ()
long long int stop ()
 StopWatch (const bool calibrate=false)

Private Attributes

std::chrono::time_point< ClockT > myEnd
std::vector< TimeT > myHistory
std::chrono::time_point< ClockT > myStart
TimeT myTimingCost

Detailed Description

template<typename TimeT = std::chrono::milliseconds, typename ClockT = std::chrono::steady_clock>
class StopWatch< TimeT, ClockT >

Definition at line 35 of file StopWatch.h.

Constructor & Destructor Documentation

◆ StopWatch()

template<typename TimeT = std::chrono::milliseconds, typename ClockT = std::chrono::steady_clock>
StopWatch< TimeT, ClockT >::StopWatch ( const bool calibrate = false)
inline

Definition at line 37 of file StopWatch.h.

References myEnd, myStart, myTimingCost, and start().

Referenced by add().

Here is the caller graph for this function:

Member Function Documentation

◆ add()

template<typename TimeT = std::chrono::milliseconds, typename ClockT = std::chrono::steady_clock>
void StopWatch< TimeT, ClockT >::add ( const StopWatch< TimeT, ClockT > & other)
inline

Definition at line 63 of file StopWatch.h.

References myHistory, and StopWatch().

Referenced by MSEdgeControl::~MSEdgeControl().

Here is the caller graph for this function:

◆ elapsed()

template<typename TimeT = std::chrono::milliseconds, typename ClockT = std::chrono::steady_clock>
long long int StopWatch< TimeT, ClockT >::elapsed ( ) const
inline

Definition at line 57 of file StopWatch.h.

References myEnd, myHistory, myStart, and myTimingCost.

Referenced by stop().

Here is the caller graph for this function:

◆ getAverage()

template<typename TimeT = std::chrono::milliseconds, typename ClockT = std::chrono::steady_clock>
long long int StopWatch< TimeT, ClockT >::getAverage ( ) const
inline

Definition at line 71 of file StopWatch.h.

References myHistory.

Referenced by MSEdgeControl::~MSEdgeControl().

Here is the caller graph for this function:

◆ getHistory()

template<typename TimeT = std::chrono::milliseconds, typename ClockT = std::chrono::steady_clock>
const std::vector< TimeT > & StopWatch< TimeT, ClockT >::getHistory ( ) const
inline

Definition at line 67 of file StopWatch.h.

References myHistory.

Referenced by MSEdgeControl::~MSEdgeControl().

Here is the caller graph for this function:

◆ getTotal()

template<typename TimeT = std::chrono::milliseconds, typename ClockT = std::chrono::steady_clock>
long long int StopWatch< TimeT, ClockT >::getTotal ( ) const
inline

Definition at line 75 of file StopWatch.h.

References myHistory.

Referenced by MSEdgeControl::~MSEdgeControl().

Here is the caller graph for this function:

◆ start()

template<typename TimeT = std::chrono::milliseconds, typename ClockT = std::chrono::steady_clock>
void StopWatch< TimeT, ClockT >::start ( )
inline

Definition at line 48 of file StopWatch.h.

References myEnd, and myStart.

Referenced by StopWatch().

Here is the caller graph for this function:

◆ stop()

template<typename TimeT = std::chrono::milliseconds, typename ClockT = std::chrono::steady_clock>
long long int StopWatch< TimeT, ClockT >::stop ( )
inline

Definition at line 52 of file StopWatch.h.

References elapsed(), and myEnd.

Field Documentation

◆ myEnd

template<typename TimeT = std::chrono::milliseconds, typename ClockT = std::chrono::steady_clock>
std::chrono::time_point<ClockT> StopWatch< TimeT, ClockT >::myEnd
private

Definition at line 81 of file StopWatch.h.

Referenced by elapsed(), start(), stop(), and StopWatch().

◆ myHistory

template<typename TimeT = std::chrono::milliseconds, typename ClockT = std::chrono::steady_clock>
std::vector<TimeT> StopWatch< TimeT, ClockT >::myHistory
mutableprivate

Definition at line 83 of file StopWatch.h.

Referenced by add(), elapsed(), getAverage(), getHistory(), and getTotal().

◆ myStart

template<typename TimeT = std::chrono::milliseconds, typename ClockT = std::chrono::steady_clock>
std::chrono::time_point<ClockT> StopWatch< TimeT, ClockT >::myStart
private

Definition at line 80 of file StopWatch.h.

Referenced by elapsed(), start(), and StopWatch().

◆ myTimingCost

template<typename TimeT = std::chrono::milliseconds, typename ClockT = std::chrono::steady_clock>
TimeT StopWatch< TimeT, ClockT >::myTimingCost
private

Definition at line 82 of file StopWatch.h.

Referenced by elapsed(), and StopWatch().


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