authorgravatar for tristan.ross@midstall.comTristan Ross <tristan.ross@midstall.com> 2023-12-20 09:33:59-08:00
committergravatar for tristan.ross@midstall.comTristan Ross <tristan.ross@midstall.com> 2023-12-20 20:05:16-08:00
log97fd100471ea74acd3a18c5bbc95efc8f8978b93
treedb681498cf81d992844dbbd88e27fc3b927a4515
parent23adf095798b8345997b2cbe182c7f109fe1da49
signaturelock-open Commit is signed but in an unrecognized format.

os.uefi: add ns to epoch


2 files changed, 3 insertions(+), 2 deletions(-)

lib/std/os/uefi.zig+2-1
...@@ -153,7 +153,8 @@ pub const Time = extern struct {...@@ -153,7 +153,8 @@ pub const Time = extern struct {
153 days += daysInYear(self.year, @as(u4, @intCast(self.month)) - 1) + self.day;153 days += daysInYear(self.year, @as(u4, @intCast(self.month)) - 1) + self.day;
154 const hours = self.hour + (days * 24);154 const hours = self.hour + (days * 24);
155 const minutes = self.minute + (hours * 60);155 const minutes = self.minute + (hours * 60);
156 return self.second + (minutes * 60);156 const seconds = self.second + (minutes * std.time.s_per_min);
157 return self.nanosecond + (seconds * std.time.ns_per_s);
157 }158 }
158};159};
159160
lib/std/time.zig+1-1
...@@ -118,7 +118,7 @@ pub fn nanoTimestamp() i128 {...@@ -118,7 +118,7 @@ pub fn nanoTimestamp() i128 {
118 var value: std.os.uefi.Time = undefined;118 var value: std.os.uefi.Time = undefined;
119 const status = std.os.uefi.system_table.runtime_services.getTime(&value, null);119 const status = std.os.uefi.system_table.runtime_services.getTime(&value, null);
120 assert(status == .Success);120 assert(status == .Success);
121 return @as(i128, @intCast(value.toEpoch())) * ms_per_s;121 return value.toEpoch();
122 }122 }
123123
124 var ts: os.timespec = undefined;124 var ts: os.timespec = undefined;