From fcf5ef0db647e7f3dac05359101d6af5693b589c Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 3 Sep 2014 19:20:23 +0100 Subject: [PATCH] Changed time function name to reflect that it actually returns Microseconds as reported in #323 --- include/internal/catch_timer.h | 2 +- include/internal/catch_timer.hpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/internal/catch_timer.h b/include/internal/catch_timer.h index 015f88bc..22e9e635 100644 --- a/include/internal/catch_timer.h +++ b/include/internal/catch_timer.h @@ -22,7 +22,7 @@ namespace Catch { public: Timer() : m_ticks( 0 ) {} void start(); - unsigned int getElapsedNanoseconds() const; + unsigned int getElapsedMicroseconds() const; unsigned int getElapsedMilliseconds() const; double getElapsedSeconds() const; diff --git a/include/internal/catch_timer.hpp b/include/internal/catch_timer.hpp index b60fa2b5..988382b3 100644 --- a/include/internal/catch_timer.hpp +++ b/include/internal/catch_timer.hpp @@ -46,14 +46,14 @@ namespace Catch { void Timer::start() { m_ticks = getCurrentTicks(); } - unsigned int Timer::getElapsedNanoseconds() const { + unsigned int Timer::getElapsedMicroseconds() const { return static_cast(getCurrentTicks() - m_ticks); } unsigned int Timer::getElapsedMilliseconds() const { - return static_cast((getCurrentTicks() - m_ticks)/1000); + return static_cast(getElapsedMicroseconds()/1000); } double Timer::getElapsedSeconds() const { - return (getCurrentTicks() - m_ticks)/1000000.0; + return getElapsedMicroseconds()/1000000.0; } } // namespace Catch