1 #ifndef _TIMESTAMP_H___
2 #define _TIMESTAMP_H___
5 #include <linux/can/bcm.h>
12 * \brief The Timestamp class provides system time and monotonic time helper functions
13 * Timestamp is meant to be a singleton class. Access through instance().
15 * double currentMonotonicTime = amb::Timestamp::instance()->currentTime();
16 * double epocTimeForMonotonicTime = amb::Timestamp::instance()->epochTime(currentMonotonicTime);
27 * \return current monotonic (steady) time in seconds.
30 double currentTime(double time);
34 * \param time monotonic time usually from currentTime()
35 * \return number of seconds.milliseconds since unix epoch
37 double epochTime(double time);
41 * \return current system time in seconds since unix epoch
45 static double fromTimeval(const struct ::timeval& tv);
46 static struct ::timeval toTimeval(const double time);
48 static struct ::bcm_timeval toBcmTimeval(const double time);
53 * \return instance of Timestamp;
55 static Timestamp *instance();
58 double startTimeEpoch;
59 static Timestamp* mInstance;