Time (Windows): prefers RTL APIs

This commit is contained in:
李通洲
2026-03-23 10:03:12 +08:00
parent e3d7eab4df
commit 76d6e86fe5
3 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ FFTimeGetAgeResult ffTimeGetAge(uint64_t birthMs, uint64_t nowMs)
static void ffTimeInitQpcMultiplier(void)
{
LARGE_INTEGER frequency;
QueryPerformanceFrequency(&frequency);
RtlQueryPerformanceFrequency(&frequency);
ffQpcMultiplier = 1000. / (double) frequency.QuadPart;
}
#endif
+1 -1
View File
@@ -18,7 +18,7 @@ static inline double ffTimeGetTick(void) //In msec
#ifdef _WIN32
extern double ffQpcMultiplier;
LARGE_INTEGER start;
QueryPerformanceCounter(&start);
RtlQueryPerformanceCounter(&start);
return (double) start.QuadPart * ffQpcMultiplier;
#elif defined(__HAIKU__)
return (double) system_time() / 1000.;
+8
View File
@@ -1363,3 +1363,11 @@ NTSYSAPI NTSTATUS NTAPI NtUnmapViewOfSection(
_In_ HANDLE ProcessHandle,
_In_opt_ PVOID BaseAddress
);
NTSYSAPI LOGICAL NTAPI RtlQueryPerformanceCounter(
_Out_ PLARGE_INTEGER PerformanceCounter
);
NTSYSAPI LOGICAL NTAPI RtlQueryPerformanceFrequency(
_Out_ PLARGE_INTEGER PerformanceFrequency
);