Skip to content

perf(env_windows): precise time with runtime fallback - #1366

Open
PyXMR2025 wants to merge 1 commit into
google:mainfrom
PyXMR2025:fix-env
Open

PyXMR2025 wants to merge 1 commit into
google:mainfrom
PyXMR2025:fix-env

Conversation

@PyXMR2025

@PyXMR2025 PyXMR2025 commented Oct 6, 2026 •

Copy link
Copy Markdown

ready for review

  • use GetSystemTimePreciseAsFileTime, completing TODO(cmumford): Switch to GetSystemTimePreciseAsFileTime which is available in Windows 8 and later

GetSystemTimePreciseAsFileTime is available in Windows 8 and later

It provides sub-microsecond resolution, versus the 10-20 msec resolution of GetSystemTimeAsFileTime.

Since the function is not exported by Kernel32 on older systems, it is resolved at runtime via GetProcAddress(); GetSystemTimeAsFileTime() is used as a fallback so the module still loads on Windows 7 and earlier.

@PyXMR2025
PyXMR2025 force-pushed the fix-env branch 2 times, most recently from 6a3043d to 9abc400 Compare October 6, 2026 03:52
GetSystemTimePreciseAsFileTime() is only available on Windows 8 and later. Resolve it at runtime with GetProcAddress() and fall back to GetSystemTimeAsFileTime() on older systems.
@PyXMR2025 PyXMR2025 changed the title perf(env_windows): use GetSystemTimePreciseAsFileTime perf(env_windows): precise time with runtime fallback Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant