| author | |
| committer | |
| log | 80404cc928c758f7063da42a0d68669998613969 |
| tree | c1ecf449d05d8c404f9c7b880e4e5059f425ee21 |
| parent | 2e424e019f6e7e12656a045ed4b9804f786dede9 |
1 files changed, 8 insertions(+), 0 deletions(-)
lib/std/time.zig+8| ... | ... | @@ -46,6 +46,14 @@ pub fn sleep(nanoseconds: u64) void { |
| 46 | 46 | return; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | if (builtin.os.tag == .uefi) { | |
| 50 | const boot_services = os.uefi.system_table.boot_services.?; | |
| 51 | const us_from_ns = nanoseconds / ns_per_us; | |
| 52 | const us = math.cast(usize, us_from_ns) orelse math.maxInt(usize); | |
| 53 | _ = boot_services.stall(us); | |
| 54 | return; | |
| 55 | } | |
| 56 | ||
| 49 | 57 | const s = nanoseconds / ns_per_s; |
| 50 | 58 | const ns = nanoseconds % ns_per_s; |
| 51 | 59 | std.os.nanosleep(s, ns); |