Files
tyra-linux/engine/src/time/timer.cpp
T
2022-07-17 10:21:35 +02:00

30 lines
614 B
C++

/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2020, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#include "time/timer.hpp"
namespace Tyra {
Timer::Timer() { prime(); }
Timer::~Timer() {}
u32 Timer::getTimeDelta() {
time = *T3_COUNT;
if (time < lastTime) // The counter has wrapped
change = time + (65536 - lastTime);
else
change = time - lastTime;
return change;
}
} // namespace Tyra