qxLib
benchmark.inl
Go to the documentation of this file.
1 /**
2 
3  @file benchmark.inl
4  @author Khrapov
5  @date 20.08.2021
6  @copyright © Nick Khrapov, 2021. All right reserved.
7 
8 **/
9 
10 namespace qx
11 {
12 
13 inline void benchmark::start()
14 {
15  m_Start = clock::now();
16 }
17 
18 inline double benchmark::end()
19 {
20  m_LastDuration = clock::now() - m_Start;
21  return last();
22 }
23 
24 inline double benchmark::last() const
25 {
26  return static_cast<double>(m_LastDuration.count()) / 1e9;
27 }
28 
29 } // namespace qx
void start()
Start benchmark.
Definition: benchmark.inl:13
double last() const
Get last benchmark time.
Definition: benchmark.inl:24
double end()
End benchmark.
Definition: benchmark.inl:18