MADARA  3.2.3
madara::utility::Timer< CLOCK > Class Template Reference

Manages a timer for duration testing. More...

#include <Timer.h>

Public Member Functions

template<typename PERIOD = std::chrono::nanoseconds>
uint64_t duration (void) const
 Returns a duration in user-specified period. More...
 
double duration_ds (void) const
 Returns a duration in seconds (double format) More...
 
uint64_t duration_ns (void) const
 Returns a duration in nanoseconds. More...
 
uint64_t duration_s (void) const
 Returns a duration in seconds. More...
 
void start (void)
 Starts the timer. More...
 
void stop (void)
 Stops the timer. More...
 

Private Attributes

std::chrono::time_point< CLOCK > end_
 the end of the timer duration More...
 
std::chrono::time_point< CLOCK > start_
 the start of the timer duration More...
 

Detailed Description

template<typename CLOCK = std::chrono::steady_clock>
class madara::utility::Timer< CLOCK >

Manages a timer for duration testing.

Definition at line 16 of file Timer.h.

Member Function Documentation

template<typename CLOCK = std::chrono::steady_clock>
template<typename PERIOD = std::chrono::nanoseconds>
uint64_t madara::utility::Timer< CLOCK >::duration ( void  ) const
inline

Returns a duration in user-specified period.

Returns
the duration of the timer in period

Definition at line 76 of file Timer.h.

template<typename CLOCK = std::chrono::steady_clock>
double madara::utility::Timer< CLOCK >::duration_ds ( void  ) const
inline

Returns a duration in seconds (double format)

Returns
the duration of the timer in seconds

Definition at line 63 of file Timer.h.

template<typename CLOCK = std::chrono::steady_clock>
uint64_t madara::utility::Timer< CLOCK >::duration_ns ( void  ) const
inline

Returns a duration in nanoseconds.

Returns
the duration of the timer in nanoseconds

Definition at line 39 of file Timer.h.

template<typename CLOCK = std::chrono::steady_clock>
uint64_t madara::utility::Timer< CLOCK >::duration_s ( void  ) const
inline

Returns a duration in seconds.

Returns
the duration of the timer in seconds

Definition at line 51 of file Timer.h.

template<typename CLOCK = std::chrono::steady_clock>
void madara::utility::Timer< CLOCK >::start ( void  )
inline

Starts the timer.

Affects future duration calls.

Definition at line 22 of file Timer.h.

template<typename CLOCK = std::chrono::steady_clock>
void madara::utility::Timer< CLOCK >::stop ( void  )
inline

Stops the timer.

Affects future duration calls.

Definition at line 30 of file Timer.h.

Member Data Documentation

template<typename CLOCK = std::chrono::steady_clock>
std::chrono::time_point<CLOCK> madara::utility::Timer< CLOCK >::end_
private

the end of the timer duration

Definition at line 90 of file Timer.h.

template<typename CLOCK = std::chrono::steady_clock>
std::chrono::time_point<CLOCK> madara::utility::Timer< CLOCK >::start_
private

the start of the timer duration

Definition at line 87 of file Timer.h.


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