mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-30 01:03:30 +01:00
Changed time function name to reflect that it actually returns Microseconds as reported in #323
This commit is contained in:
parent
ee5e7ed2c9
commit
fcf5ef0db6
@ -22,7 +22,7 @@ namespace Catch {
|
|||||||
public:
|
public:
|
||||||
Timer() : m_ticks( 0 ) {}
|
Timer() : m_ticks( 0 ) {}
|
||||||
void start();
|
void start();
|
||||||
unsigned int getElapsedNanoseconds() const;
|
unsigned int getElapsedMicroseconds() const;
|
||||||
unsigned int getElapsedMilliseconds() const;
|
unsigned int getElapsedMilliseconds() const;
|
||||||
double getElapsedSeconds() const;
|
double getElapsedSeconds() const;
|
||||||
|
|
||||||
|
@ -46,14 +46,14 @@ namespace Catch {
|
|||||||
void Timer::start() {
|
void Timer::start() {
|
||||||
m_ticks = getCurrentTicks();
|
m_ticks = getCurrentTicks();
|
||||||
}
|
}
|
||||||
unsigned int Timer::getElapsedNanoseconds() const {
|
unsigned int Timer::getElapsedMicroseconds() const {
|
||||||
return static_cast<unsigned int>(getCurrentTicks() - m_ticks);
|
return static_cast<unsigned int>(getCurrentTicks() - m_ticks);
|
||||||
}
|
}
|
||||||
unsigned int Timer::getElapsedMilliseconds() const {
|
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 {
|
double Timer::getElapsedSeconds() const {
|
||||||
return (getCurrentTicks() - m_ticks)/1000000.0;
|
return getElapsedMicroseconds()/1000000.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Catch
|
} // namespace Catch
|
||||||
|
Loading…
Reference in New Issue
Block a user