automotive-message-broker  0.14.803
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
amb::Timestamp Class Reference

The Timestamp class provides system time and monotonic time helper functions Timestamp is meant to be a singleton class. Access through instance(). More...

#include <timestamp.h>

Public Member Functions

double currentTime ()
 currentTime
 
double currentTime (double time)
 
double epochTime (double time)
 epochTime
 
double epochTime ()
 epochTime
 

Static Public Member Functions

static double fromTimeval (const struct::timeval &tv)
 
static struct::timeval toTimeval (const double time)
 
static struct::bcm_timeval toBcmTimeval (const double time)
 
static Timestampinstance ()
 instance
 

Detailed Description

The Timestamp class provides system time and monotonic time helper functions Timestamp is meant to be a singleton class. Access through instance().

double currentMonotonicTime = amb::Timestamp::instance()->currentTime();
double epocTimeForMonotonicTime = amb::Timestamp::instance()->epochTime(currentMonotonicTime);

Member Function Documentation

double amb::Timestamp::currentTime ( )

currentTime

Returns
current monotonic (steady) time in seconds.
double amb::Timestamp::epochTime ( double  time)

epochTime

Parameters
timemonotonic time usually from currentTime()
Returns
number of seconds.milliseconds since unix epoch
double amb::Timestamp::epochTime ( )

epochTime

Returns
current system time in seconds since unix epoch
static Timestamp* amb::Timestamp::instance ( )
static

instance

Returns
instance of Timestamp;

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