Create Clock.cpp

This commit is contained in:
2021-12-01 20:39:59 +01:00
committed by GitHub
parent fe13f3d6b4
commit 22b6f477ba

20
internal/Clock.cpp Normal file
View 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;
}
}