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 
00035 /*****************************************************************************
00036 ** Namespaces
00037 *****************************************************************************/
00038 
00039 namespace ecl {
00040 
00041 /*****************************************************************************
00042 ** Classes
00043 *****************************************************************************/
00071 class ECL_PUBLIC CpuWatch
00072 {
00073     public:
00078         CpuWatch();
00079 
00080         virtual ~CpuWatch() {}
00087         void restart();
00088 
00095         TimeStamp elapsed();
00102         TimeStamp split();
00103 
00104     private:
00105         TimeStamp start_time, split_time;
00106         timespec tmp; // use for temporary cacluations.
00107 };
00108 
00109 }; // namespace ecl
00110 
00111 #endif /* MANY POSIX TIME REQ'MENTS */
00112 #endif /* ECL_IS_POSIX */
00113 #endif /* ECL_TIME_CPUWATCH_POS_HPP_ */


ecl_time
Author(s): Daniel Stonier (d.stonier@gmail.com)
autogenerated on Thu Jan 2 2014 11:12:43