From 0916ab0c1cd8e6be386adf63b5b473003391f094 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Tue, 2 Jul 2024 20:10:07 +0200 Subject: [PATCH] Fix Windows build and small adjustments to Sys_MillisecondsPrecise() for the nsec part of struct timespec a simple long is enough --- neo/sys/aros/aros_main.cpp | 2 +- neo/sys/posix/posix_main.cpp | 2 +- neo/sys/win32/win_main.cpp | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/neo/sys/aros/aros_main.cpp b/neo/sys/aros/aros_main.cpp index 97da94f99..d3ca294f0 100644 --- a/neo/sys/aros/aros_main.cpp +++ b/neo/sys/aros/aros_main.cpp @@ -956,7 +956,7 @@ double Sys_MillisecondsPrecise() { clock_gettime(CLOCK_MONOTONIC, &now); long long sec = now.tv_sec - first.tv_sec; - long long nsec = now.tv_nsec - first.tv_nsec; + long nsec = now.tv_nsec - first.tv_nsec; double ret = sec * 1000.0; ret += double(nsec) * 0.000001; diff --git a/neo/sys/posix/posix_main.cpp b/neo/sys/posix/posix_main.cpp index 492bfd0f4..75e5b8db2 100644 --- a/neo/sys/posix/posix_main.cpp +++ b/neo/sys/posix/posix_main.cpp @@ -548,7 +548,7 @@ double Sys_MillisecondsPrecise() { #endif long long sec = now.tv_sec - first.tv_sec; - long long nsec = now.tv_nsec - first.tv_nsec; + long nsec = now.tv_nsec - first.tv_nsec; double ret = sec * 1000.0; ret += double(nsec) * 0.000001; diff --git a/neo/sys/win32/win_main.cpp b/neo/sys/win32/win_main.cpp index 7eb85f3b7..03b8cab08 100644 --- a/neo/sys/win32/win_main.cpp +++ b/neo/sys/win32/win_main.cpp @@ -1051,7 +1051,6 @@ static void Win_InitTime() { } double after = Sys_MillisecondsPrecise(); double callDiff = after - before; - printf( "Win_InitTime(): 1000 calls to Sys_MillisecondsPrecise() took %g usec (%g usec per call)\n", diff*1000, diff ); #ifdef D3_CpuPause // figure out how long D3_CpuPause() instructions take