ROSEndEffector
ROS End-Effector package: provides a ROS-based set of standard interfaces to command robotics end-effectors in an agnostic fashion.
Public Member Functions | Private Attributes | List of all members
ROSEE::Utils::Timer< Clock > Class Template Reference

#include <Utils.h>

+ Collaboration diagram for ROSEE::Utils::Timer< Clock >:

Public Member Functions

 Timer ()
 
void reset ()
 
template<typename Rep = typename Clock::duration::rep, typename Units = typename Clock::duration>
Rep elapsed_time () const
 

Private Attributes

Clock::time_point start_point
 

Detailed Description

template<typename Clock = std::chrono::high_resolution_clock>
class ROSEE::Utils::Timer< Clock >

Definition at line 274 of file Utils.h.

Constructor & Destructor Documentation

template<typename Clock = std::chrono::high_resolution_clock>
ROSEE::Utils::Timer< Clock >::Timer ( )
inline

Definition at line 279 of file Utils.h.

279 : start_point(Clock::now()) {}
Clock::time_point start_point
Definition: Utils.h:276

Member Function Documentation

template<typename Clock = std::chrono::high_resolution_clock>
template<typename Rep = typename Clock::duration::rep, typename Units = typename Clock::duration>
Rep ROSEE::Utils::Timer< Clock >::elapsed_time ( ) const
inline

Definition at line 284 of file Utils.h.

285  {
286  std::atomic_thread_fence(std::memory_order_relaxed);
287  auto counted_time = std::chrono::duration_cast<Units>(Clock::now() - start_point).count();
288  std::atomic_thread_fence(std::memory_order_relaxed);
289  return static_cast<Rep>(counted_time);
290  }
Clock::time_point start_point
Definition: Utils.h:276
template<typename Clock = std::chrono::high_resolution_clock>
void ROSEE::Utils::Timer< Clock >::reset ( )
inline

Definition at line 281 of file Utils.h.

281 { start_point = Clock::now(); }
Clock::time_point start_point
Definition: Utils.h:276

Member Data Documentation

template<typename Clock = std::chrono::high_resolution_clock>
Clock::time_point ROSEE::Utils::Timer< Clock >::start_point
private

Definition at line 276 of file Utils.h.


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