#pragma once #include #include class TickSystem { private: std::chrono::duration timer{ 0 }; std::chrono::duration tickRate; public: TickSystem(std::chrono::duration tickRateSeconds) : tickRate(tickRateSeconds) { } bool update(std::chrono::duration deltaTime) { timer += deltaTime; if (timer >= tickRate) { timer -= tickRate; return true; } return false; } };