.. _program_listing_file__tmp_ws_src_ecl_core_ecl_time_include_ecl_time_cpuwatch_rt.hpp: Program Listing for File cpuwatch_rt.hpp ======================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/ecl_core/ecl_time/include/ecl/time/cpuwatch_rt.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /***************************************************************************** ** Ifdefs *****************************************************************************/ #ifndef ECL_TIME_CPUWATCH_POS_HPP_ #define ECL_TIME_CPUWATCH_POS_HPP_ /***************************************************************************** ** Platform Check *****************************************************************************/ #include #if defined(ECL_IS_POSIX) // monotonic clock, cpu clock -> clock_gettime; clock_selection -> clock_nanosleep #if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK) >= 0L && defined(_POSIX_CLOCK_SELECTION) && (_POSIX_CLOCK_SELECTION) >= 0L /***************************************************************************** ** Includes *****************************************************************************/ #include #include "timestamp.hpp" #include "macros.hpp" /***************************************************************************** ** Namespaces *****************************************************************************/ namespace ecl { /***************************************************************************** ** Classes *****************************************************************************/ class ecl_time_PUBLIC CpuWatch { public: CpuWatch(); virtual ~CpuWatch() {} void restart(); TimeStamp elapsed(); TimeStamp split(); private: TimeStamp start_time, split_time; timespec tmp; // use for temporary cacluations. }; } // namespace ecl #endif /* MANY POSIX TIME REQ'MENTS */ #endif /* ECL_IS_POSIX */ #endif /* ECL_TIME_CPUWATCH_POS_HPP_ */