Create Clock.cpp

This commit is contained in:
tobid7 2021-12-01 20:39:59 +01:00 committed by GitHub
parent fe13f3d6b4
commit 22b6f477ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;
}
}