Skip to content

Commit

Permalink
Fix Windows build and small adjustments to Sys_MillisecondsPrecise()
Browse files Browse the repository at this point in the history
for the nsec part of struct timespec a simple long is enough
  • Loading branch information
DanielGibson committed Jul 2, 2024
1 parent c7e184e commit 0916ab0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion neo/sys/aros/aros_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion neo/sys/posix/posix_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion neo/sys/win32/win_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0916ab0

Please sign in to comment.