From 95e1d67309fb898d5f8befe7489d0863ab18a97f Mon Sep 17 00:00:00 2001 From: agent Date: Tue, 27 Oct 2026 01:19:07 +0300 Subject: [PATCH 1/2] Modules: nanosecond wall clock Adds get_time_ns to the timing helpers next to the existing millisecond clock. --- Modules/private/Timing.cpp | 4 ++++ Modules/public/Timing.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/Modules/private/Timing.cpp b/Modules/private/Timing.cpp index 0a71c764..79472485 100644 --- a/Modules/private/Timing.cpp +++ b/Modules/private/Timing.cpp @@ -7,6 +7,8 @@ #define GETTIMEMSC() (time_ms)(std::chrono::duration_cast(std::chrono::time_point_cast(std::chrono::high_resolution_clock::now()).time_since_epoch()).count()) +#define GETTIMENSC() (time_ns)(std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch()).count()) + #define THREAD_SLEEP(time_ms) std::this_thread::sleep_for(std::chrono::milliseconds(time_ms)) tp::time_ms tp::gCurrentTime = tp::get_time(); @@ -17,6 +19,8 @@ namespace tp { return gCurrentTime; } + time_ns get_time_ns() { return GETTIMENSC(); } + void updateGlobalTime() { get_time(); } diff --git a/Modules/public/Timing.hpp b/Modules/public/Timing.hpp index 505738b6..e8858b76 100644 --- a/Modules/public/Timing.hpp +++ b/Modules/public/Timing.hpp @@ -35,6 +35,7 @@ namespace tp { void sleep(time_ms duration); time_ms get_time(); + time_ns get_time_ns(); void updateGlobalTime(); struct FpsCounter { -- 2.49.1 From 8185114cd4da9929be90d178b6d33f41431ac903 Mon Sep 17 00:00:00 2001 From: agent Date: Tue, 27 Oct 2026 01:19:07 +0300 Subject: [PATCH 2/2] Modules: name the Android enumerator uppercase Environment declares the OS enumerators in upper case, but the Android branch initialised mOS with OS::ANDOID, which is not a member, so that branch could not compile. Spell it OS::ANDROID. --- Modules/public/Environment.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/public/Environment.hpp b/Modules/public/Environment.hpp index 43bc75a2..032b5d68 100644 --- a/Modules/public/Environment.hpp +++ b/Modules/public/Environment.hpp @@ -91,7 +91,7 @@ namespace tp { #define ENV_OS_LINUX enum class OS { UNDEF, LINUX, WINDOWS, ANDROID, IOS } mOS = OS::LINUX; #elif defined(__ANDROID__) - enum class OS { UNDEF, LINUX, WINDOWS, ANDROID, IOS } mOS = OS::ANDOID; + enum class OS { UNDEF, LINUX, WINDOWS, ANDROID, IOS } mOS = OS::ANDROID; #define ENV_OS_ANDROID #else #error "unexplored compilation to target os" -- 2.49.1