TimeUtil.h File Reference
#include <chrono>
#include <IceUtil/Time.h>
#include <ArmarXCore/interface/core/TimeServerInterface.h>

Classes

class  TimeUtil
 provides utility functions for getting the current time More...
 

Namespaces

namespace  armarx
 This file offers overloads of toIce() and fromIce() functions for STL container types.
 

Macros

#define GENERATE_TIME_OPERATOR_COMP(op)
 
#define GENERATE_TIME_OPERATORS_ARITH(op)
 
#define TIMING_CEND(name, thresholdMs)
 Prints duration if it took longer than thresholdMs.
 
#define TIMING_CEND_COMMENT(name, comment, thresholdMs)
 Prints duration with comment in front of it if it took longer than threshold.
 
#define TIMING_END(name)
 Prints duration.
 
#define TIMING_END_COMMENT(name, comment)
 Prints duration with comment in front of it, yet only once per second.
 
#define TIMING_END_COMMENT_STREAM(name, comment, os)
 Prints duration with comment in front of it, yet only once per second.
 
#define TIMING_END_STREAM(name, os)
 Prints duration.
 
#define TIMING_START(name)
 Helper macro to do timing tests.
 

Enumerations

enum class  TimeMode { SystemTime , VirtualTime }
 Time mode to be used. More...
 

Macro Definition Documentation

◆ GENERATE_TIME_OPERATOR_COMP

#define GENERATE_TIME_OPERATOR_COMP ( op)
Value:
template <class Rep, class Period> \
inline bool operator op(IceUtil::Time a, std::chrono::duration<Rep, Period> b) \
{ \
return a.toMicroSeconds() op std::chrono::duration_cast<std::chrono::microseconds>(b) \
.count(); \
} \
template <class Rep, class Period> \
inline bool operator op(std::chrono::duration<Rep, Period> a, IceUtil::Time b) \
{ \
return std::chrono::duration_cast<std::chrono::microseconds>(a).count() \
op b.toMicroSeconds(); \
}

◆ GENERATE_TIME_OPERATORS_ARITH

#define GENERATE_TIME_OPERATORS_ARITH ( op)
Value:
template <class Rep, class Period> \
inline IceUtil::Time operator op(IceUtil::Time a, std::chrono::duration<Rep, Period> b) \
{ \
return a op IceUtil::Time::microSeconds( \
std::chrono::duration_cast<std::chrono::microseconds>(b).count()); \
} \
template <class Rep, class Period> \
inline IceUtil::Time operator op(std::chrono::duration<Rep, Period> a, IceUtil::Time b) \
{ \
return IceUtil::Time::microSeconds( \
std::chrono::duration_cast<std::chrono::microseconds>(a).count()) op b; \
}