HOG2
Timer.cpp
Go to the documentation of this file.
1 #include "Timer.h"
2 
4 {
5  elapsedTime = 0;
6 }
7 
8 
10 {
11  startTime = std::chrono::high_resolution_clock::now();
12 }
13 
14 
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 
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