Use GetSystemTimePreciseAsFileTime if it is available

This commit is contained in:
Dan Aloni 2020-03-09 17:40:31 +02:00
parent 3dbade652e
commit 0605abe3bb
2 changed files with 5 additions and 1 deletions

View File

@ -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,

View File

@ -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
}
}