cpuwatch_rt.hpp
Go to the documentation of this file.
00001 
00011 /*****************************************************************************
00012 ** Ifdefs
00013 *****************************************************************************/
00014 
00015 #ifndef ECL_TIME_CPUWATCH_POS_HPP_
00016 #define ECL_TIME_CPUWATCH_POS_HPP_
00017 
00018 /*****************************************************************************
00019 ** Platform Check
00020 *****************************************************************************/
00021 
00022 #include <ecl/config.hpp>
00023 
00024 #if defined(ECL_IS_POSIX)
00025   // monotonic clock, cpu clock -> clock_gettime; clock_selection -> clock_nanosleep
00026   #if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK) >= 0L && defined(_POSIX_CLOCK_SELECTION) && (_POSIX_CLOCK_SELECTION) >= 0L
00027 
00028 /*****************************************************************************
00029 ** Includes
00030 *****************************************************************************/
00031 
00032 #include <ecl/config/macros.hpp>
00033 #include "timestamp.hpp"
00034 #include "macros.hpp"
00035 
00036 /*****************************************************************************
00037 ** Namespaces
00038 *****************************************************************************/
00039 
00040 namespace ecl {
00041 
00042 /*****************************************************************************
00043 ** Classes
00044 *****************************************************************************/
00072 class ecl_time_PUBLIC CpuWatch
00073 {
00074     public:
00079         CpuWatch();
00080 
00081         virtual ~CpuWatch() {}
00088         void restart();
00089 
00096         TimeStamp elapsed();
00103         TimeStamp split();
00104 
00105     private:
00106         TimeStamp start_time, split_time;
00107         timespec tmp; // use for temporary cacluations.
00108 };
00109 
00110 }; // namespace ecl
00111 
00112 #endif /* MANY POSIX TIME REQ'MENTS */
00113 #endif /* ECL_IS_POSIX */
00114 #endif /* ECL_TIME_CPUWATCH_POS_HPP_ */


ecl_time
Author(s): Daniel Stonier
autogenerated on Wed Aug 26 2015 11:27:17