Merge pull request #48 from CogentEmbedded/master
[profile/ivi/automotive-message-broker.git] / lib / timestamp.h
index 0495235..0e7d1b6 100644 (file)
@@ -7,23 +7,48 @@ namespace amb {
 
 double currentTime();
 
+/*!
+ * \brief The Timestamp class provides system time and monotonic time helper functions
+ * Timestamp is meant to be a singleton class.  Access through instance().
+ * \code
+ * double currentMonotonicTime = amb::Timestamp::instance()->currentTime();
+ * double epocTimeForMonotonicTime = amb::Timestamp::instance()->epochTime(currentMonotonicTime);
+ * \endcode
+ */
 class Timestamp {
 protected:
        Timestamp();
 
 public:
 
+       /*!
+        * \brief currentTime
+        * \return current monotonic (steady) time in seconds.
+        */
        double currentTime();
        double currentTime(double time);
 
+       /*!
+        * \brief epochTime
+        * \param time monotonic time usually from currentTime()
+        * \return number of seconds.milliseconds since unix epoch
+        */
        double epochTime(double time);
 
+       /*!
+        * \brief epochTime
+        * \return current system time in seconds since unix epoch
+        */
        double epochTime();
 
     static double fromTimeval(const struct ::timeval& tv);
     static struct ::timeval toTimeval(const double time);
 
 public:
+       /*!
+        * \brief instance
+        * \return instance of Timestamp;
+        */
        static Timestamp *instance();
 
 private: