From 9e019ade8e41297333f2ab4ebdb8eb06c8159c97 Mon Sep 17 00:00:00 2001 From: Prabhu Ullagaddi <19570677+prabhu-yu@users.noreply.github.com> Date: Sun, 3 Aug 2025 15:10:12 +0530 Subject: [PATCH] Update platform_esp32_idf.c --- lib/platform_esp32_idf.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/platform_esp32_idf.c b/lib/platform_esp32_idf.c index a84e6fbf..18fc14a5 100644 --- a/lib/platform_esp32_idf.c +++ b/lib/platform_esp32_idf.c @@ -42,7 +42,16 @@ int platform_random(int max) uint64_t platform_tick_get_ms(void) { +#ifdef __linux__ +#include +#include +#include // For NULL + struct timeval tv; + gettimeofday(&tv, NULL); + return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec; +#else return esp_timer_get_time()/(int64_t)1000; +#endif } #endif