Radium Engine
1.5.20
Loading...
Searching...
No Matches
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
std::chrono::duration_cast
T duration_cast(T... args)
std::chrono::duration
std::chrono::high_resolution_clock
Ra
hepler function to manage enum as underlying types in VariableSet
Definition
Cage.cpp:3
std::chrono::time_point
src
Core
Utils
Timer.hpp
Generated by
1.12.0