Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Timer.hpp
1 #pragma once
2 
3 #include <Core/RaCore.hpp>
4 #include <chrono>
5 
6 namespace Ra {
7 namespace Core {
8 // Convenience functions for timing.
9 // Wrapping the highest resolution time measuring.
10 namespace Utils {
11 using Clock = std::chrono::high_resolution_clock;
12 using TimePoint = std::chrono::time_point<Clock>;
13 
14 inline long RA_CORE_API getIntervalMicro( const TimePoint& start, const TimePoint& end ) {
15  return ( std::chrono::duration_cast<std::chrono::microseconds>( end - start ) ).count();
16 }
17 
18 inline Scalar RA_CORE_API getIntervalSeconds( const TimePoint& start, const TimePoint& end ) {
19  return ( std::chrono::duration_cast<
20  std::chrono::duration<Scalar, std::chrono::seconds::period>>( end - start ) )
21  .count();
22 }
23 
24 } // namespace Utils
25 } // namespace Core
26 } // namespace Ra
Definition: Cage.cpp:3