timestamp_counter_posix.cc 704 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

#include <embb/base/perf/timer.h>

#if defined(EMBB_BASE_CPP_PERF_TIMER_POSIX) || \
    defined(EMBB_BASE_CPP_PERF_TIMER_UX)

#include <embb/base/perf/internal/timestamp_counter_posix.h>

namespace embb {
namespace base {
namespace perf {
namespace internal {
namespace timer {

void TimestampCounterPosix::Calibrate(unsigned int freq) {
  frequencyScaling = freq == 0
                     ? 1900.0f 
                     : static_cast<double>(freq); 
}

Timestamp::counter_t TimestampCounterPosix::frequencyScaling = 1; 

} // namespace timer
} // namespace internal
} // namespace perf
} // namespace base
} // namespace embb

#endif  // EMBB_BASE_CPP_PERF_TIMER_POSIX || EMBB_BASE_CPP_PERF_TIMER_UX