Skip to content

Commit

Permalink
Use GetSystemTimePreciseAsFileTime if it is available
Browse files Browse the repository at this point in the history
  • Loading branch information
da-x committed Mar 9, 2020
1 parent 3dbade6 commit 0605abe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/libstd/sys/windows/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,10 @@ compat_fn! {
_dwBufferSize: DWORD) -> BOOL {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED as DWORD); 0
}
pub fn GetSystemTimePreciseAsFileTime(lpSystemTimeAsFileTime: LPFILETIME)
-> () {
GetSystemTimeAsFileTime(lpSystemTimeAsFileTime)
}
pub fn SleepConditionVariableSRW(ConditionVariable: PCONDITION_VARIABLE,
SRWLock: PSRWLOCK,
dwMilliseconds: DWORD,
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/windows/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl SystemTime {
pub fn now() -> SystemTime {
unsafe {
let mut t: SystemTime = mem::zeroed();
c::GetSystemTimeAsFileTime(&mut t.t);
c::GetSystemTimePreciseAsFileTime(&mut t.t);
t
}
}
Expand Down

0 comments on commit 0605abe

Please sign in to comment.