00001 #ifndef _XSENS_TIME_2006_09_12 00002 #define _XSENS_TIME_2006_09_12 00003 00004 #ifndef _PSTDINT_H_INCLUDED 00005 # include "pstdint.h" 00006 #endif 00007 00008 #include <time.h> 00009 00010 namespace xsens { 00011 00012 //! The number of seconds in a normal day 00013 #define XSENS_SEC_PER_DAY (60*60*24) 00014 //! The number of milliseconds in a normal day 00015 #define XSENS_MS_PER_DAY (XSENS_SEC_PER_DAY*1000) 00016 00017 //! A real-time timestamp (ms) 00018 typedef uint64_t TimeStamp; 00019 00020 /*! \brief A platform-independent clock. 00021 00022 The function returns the time of day in ms since midnight. If the \c date parameter is 00023 non-NULL, corresponding the date is placed in the variable it points to. 00024 */ 00025 uint32_t getTimeOfDay(tm* date_ = NULL, time_t* secs_ = NULL); 00026 00027 /*! \brief A platform-independent sleep routine. 00028 00029 Time is measured in ms. The function will not return until the specified 00030 number of ms have passed. 00031 */ 00032 void msleep(uint32_t ms); 00033 00034 TimeStamp timeStampNow(void); 00035 00036 00037 } // end of xsens namespace 00038 00039 #endif // _XSENS_TIME_2006_09_12