14 #if defined(ECL_IS_POSIX) 16 #if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK) >= 0L && defined(_POSIX_CLOCK_SELECTION) && (_POSIX_CLOCK_SELECTION) >= 0L 23 #include "../../include/ecl/time/cpuwatch_rt.hpp" 36 CpuWatch::CpuWatch() {
38 start_time.stamp(tmp.tv_sec, tmp.tv_nsec);
39 split_time = start_time;
46 void CpuWatch::restart()
49 start_time.stamp(tmp.tv_sec, tmp.tv_nsec);
50 split_time = start_time;
53 TimeStamp CpuWatch::elapsed()
56 TimeStamp current_time(tmp.tv_sec, tmp.tv_nsec);
57 return ( current_time - start_time );
60 TimeStamp CpuWatch::split()
62 TimeStamp last_time = split_time;
64 split_time.stamp(tmp.tv_sec,tmp.tv_nsec);
65 return (split_time - last_time);
Embedded control libraries.