HOG2
utils
Timer.cpp
Go to the documentation of this file.
1
#include "
Timer.h
"
2
3
Timer::Timer
()
4
{
5
elapsedTime
= 0;
6
}
7
8
9
void
Timer::StartTimer
()
10
{
11
startTime
= std::chrono::high_resolution_clock::now();
12
}
13
14
15
double
Timer::EndTimer
()
16
{
17
auto
stopTime = std::chrono::high_resolution_clock::now();
18
auto
difference = stopTime -
startTime
;
19
std::chrono::duration<double> time_span = std::chrono::duration_cast<std::chrono::duration<double>>(difference);
20
elapsedTime
= time_span.count();
21
22
return
elapsedTime
;
23
}
24
25
double
Timer::GetElapsedTime
()
26
{
27
return
elapsedTime
;
28
}
Timer::StartTimer
void StartTimer()
Definition:
Timer.cpp:9
Timer::Timer
Timer()
Definition:
Timer.cpp:3
Timer.h
Timer::elapsedTime
double elapsedTime
Definition:
Timer.h:28
Timer::GetElapsedTime
double GetElapsedTime()
Definition:
Timer.cpp:25
Timer::startTime
std::chrono::high_resolution_clock::time_point startTime
Definition:
Timer.h:27
Timer::EndTimer
double EndTimer()
Definition:
Timer.cpp:15
Generated by
1.8.17