refactor: format code

This commit is contained in:
2021-09-19 17:33:16 +02:00
parent 52a143769e
commit 0856ca47ca
71 changed files with 1102 additions and 1110 deletions

View File

@@ -4,32 +4,32 @@
namespace td {
namespace utils {
void Timer::update(){
void Timer::update() {
m_InternalTime += getTime() - m_LastTime;
if(m_InternalTime >= m_Interval){
if(m_Function != nullptr)
if (m_InternalTime >= m_Interval) {
if (m_Function != nullptr)
m_Function();
m_InternalTime %= m_Interval;
}
m_LastTime = getTime();
}
void Timer::update(std::uint64_t delta){
void Timer::update(std::uint64_t delta) {
m_InternalTime += delta;
if(m_InternalTime >= m_Interval){
if(m_Function != nullptr)
if (m_InternalTime >= m_Interval) {
if (m_Function != nullptr)
m_Function();
m_InternalTime %= m_Interval;
}
m_LastTime = getTime();
}
void Timer::reset(){
void Timer::reset() {
m_InternalTime = 0;
m_LastTime = getTime();
}
std::uint64_t getTime(){
std::uint64_t getTime() {
return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock().now().time_since_epoch()).count();
}