File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -86,15 +86,10 @@ fn now(clock: Clock) !u128 {
86
86
break :D result ;
87
87
},
88
88
.realtime = > D : {
89
- // FileTime has a granularity of 100 nanoseconds and uses the NTFS/Windows epoch,
89
+ // RtlGetSystemTimePrecise() has a granularity of 100 nanoseconds and uses the NTFS/Windows epoch,
90
90
// which is 1601-01-01.
91
91
const epoch_adj = std .time .epoch .windows * (std .time .ns_per_s / 100 );
92
- var ft : std.os.windows.FILETIME = undefined ;
93
- std .os .windows .kernel32 .GetSystemTimeAsFileTime (& ft );
94
- const ft64 = (@as (u64 , ft .dwHighDateTime ) << 32 ) | ft .dwLowDateTime ;
95
- const adjusted = @as (i64 , @bitCast (ft64 )) + epoch_adj ;
96
- std .debug .assert (adjusted > 0 );
97
- break :D @as (u128 , @intCast (adjusted )) * 100 ;
92
+ break :D @intCast (@as (i128 , std .os .windows .ntdll .RtlGetSystemTimePrecise () + epoch_adj ) * 100 );
98
93
},
99
94
},
100
95
.uefi = > D : {
You can’t perform that action at this time.
0 commit comments