Performance counter: use correct std::chrono clock

This commit is contained in:
Simon Wells 2017-01-06 09:54:38 -05:00 committed by Chris Pavlina
parent f407450732
commit 5fee9b2405
1 changed files with 4 additions and 4 deletions

View File

@ -71,7 +71,7 @@ public:
void Start() void Start()
{ {
m_running = true; m_running = true;
m_starttime = std::chrono::system_clock::now(); m_starttime = std::chrono::high_resolution_clock::now();
} }
@ -83,7 +83,7 @@ public:
if( !m_running ) if( !m_running )
return; return;
m_stoptime = std::chrono::system_clock::now(); m_stoptime = std::chrono::high_resolution_clock::now();
} }
/** /**
@ -92,7 +92,7 @@ public:
void Show() void Show()
{ {
TIME_POINT display_stoptime = m_running ? TIME_POINT display_stoptime = m_running ?
std::chrono::system_clock::now() : std::chrono::high_resolution_clock::now() :
m_stoptime; m_stoptime;
std::chrono::duration<double, std::milli> elapsed = display_stoptime - m_starttime; std::chrono::duration<double, std::milli> elapsed = display_stoptime - m_starttime;
@ -105,7 +105,7 @@ public:
double msecs() const double msecs() const
{ {
TIME_POINT stoptime = m_running ? TIME_POINT stoptime = m_running ?
std::chrono::system_clock::now() : std::chrono::high_resolution_clock::now() :
m_stoptime; m_stoptime;
std::chrono::duration<double, std::milli> elapsed = stoptime - m_starttime; std::chrono::duration<double, std::milli> elapsed = stoptime - m_starttime;