Create Clock.cpp
This commit is contained in:
parent
fe13f3d6b4
commit
22b6f477ba
20
internal/Clock.cpp
Normal file
20
internal/Clock.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include "Clock.hpp"
|
||||
|
||||
namespace rnd7 {
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
Time Clock::getElapsedTime() const {
|
||||
return getCurrentTime() - m_startTime;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
Time Clock::restart() {
|
||||
Time now = getCurrentTime();
|
||||
Time elapsed = now - m_startTime;
|
||||
m_startTime = now;
|
||||
|
||||
return elapsed;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user