This commit is contained in:
xin
2025-06-30 15:46:21 +08:00
parent 8c594933b9
commit bd5fac5ec8

View File

@ -2,7 +2,7 @@
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#elif #else
#include <unistd.h> #include <unistd.h>
#include <time.h> #include <time.h>
@ -16,7 +16,7 @@
unsigned long long get_system_uptime_ms() { unsigned long long get_system_uptime_ms() {
#ifdef _WIN32 #ifdef _WIN32
return GetTickCount64(); return GetTickCount64();
#elif #else
struct timespec ts; struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts); clock_gettime(CLOCK_MONOTONIC, &ts);
return (unsigned long long)(ts.tv_sec) * 1000 + ts.tv_nsec / 1000000; return (unsigned long long)(ts.tv_sec) * 1000 + ts.tv_nsec / 1000000;