catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Changed time function name to reflect that it actually returns Microseconds as reported in #323
- Commit
fcf5ef0db647e7f3dac05359101d6af5693b589c- Author
- Phil Nash ·
- Parents
ee5e7ed2c99d
Changes
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<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