#ifndef __JABYENGINE_TIMER_HPP__ #define __JABYENGINE_TIMER_HPP__ #include "../jabyengine_defines.h" namespace JabyEngine { class GlobalTime { public: class TimeStamp { private: size_t value; constexpr TimeStamp(size_t value) : value(value) {} public: constexpr size_t milliseconds_to(const TimeStamp& ts) const { return (ts.value - this->value); } friend class GlobalTime; }; private: static size_t global_counter; public: GlobalTime() = delete; ~GlobalTime() = delete; static TimeStamp get_time_stamp() { return TimeStamp(GlobalTime::global_counter); } }; } #endif //!__JABYENGINE_TIMER_HPP__