Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std.time: more precise nanoTimestamp in windows #22871

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

alichraghi
Copy link
Contributor

@alichraghi alichraghi commented Feb 12, 2025

Closes #22460

std.windows.SharedUserData.SystemTime is basically what GetSystemTimeAsFileTime used and NtQuerySystemTimePrecise which was mentioned in a comment doesn't exist. so unfortunately the kernel32 dependency in this case can't be removed

@alexrp
Copy link
Member

alexrp commented Feb 12, 2025

GetSystemTimePreciseAsFileTime (kernel32.dll) just appears to be a very thin wrapper around RtlGetSystemTimePrecise (ntdll.dll) that extracts the lower/upper bits of the u64 to the FILETIME components. Can't we just use RtlGetSystemTimePrecise?

@alexrp
Copy link
Member

alexrp commented Feb 12, 2025

@squeek502 any thoughts on this?

lib/std/posix.zig Outdated Show resolved Hide resolved
@alexrp alexrp merged commit bffbc91 into ziglang:master Feb 13, 2025
9 checks passed
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.

low precision of nanoTimestamp on windows
3 participants