mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 15:26:11 +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:
|
||||
Timer() : m_ticks( 0 ) {}
|
||||
void start();
|
||||
unsigned int getElapsedNanoseconds() const;
|
||||
unsigned int getElapsedMicroseconds() const;
|
||||
unsigned int getElapsedMilliseconds() const;
|
||||
double getElapsedSeconds() const;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user