diff options
| author | Phil Nash | 2014-09-03 19:20:23 +0100 |
|---|---|---|
| committer | Phil Nash | 2014-09-03 19:20:23 +0100 |
| commit | fcf5ef0db647e7f3dac05359101d6af5693b589c (patch) | |
| tree | 0bbc823c01dcf94f74b81c3f6158e7ff13e9594c /include | |
| parent | ee5e7ed2c99d0f8a49efe4d491ccb4b7941431cf (diff) | |
| download | catch3-fcf5ef0db647e7f3dac05359101d6af5693b589c.tar.gz | |
Changed time function name to reflect that it actually returns Microseconds as reported in #323
Diffstat (limited to 'include')
| -rw-r--r-- | include/internal/catch_timer.h | 2 | ||||
| -rw-r--r-- | 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<unsigned int>(getCurrentTicks() - m_ticks); } unsigned int Timer::getElapsedMilliseconds() const { - return static_cast<unsigned int>((getCurrentTicks() - m_ticks)/1000); + return static_cast<unsigned int>(getElapsedMicroseconds()/1000); } double Timer::getElapsedSeconds() const { - return (getCurrentTicks() - m_ticks)/1000000.0; + return getElapsedMicroseconds()/1000000.0; } } // namespace Catch |