freebsd: implement std.os.time.sleep

master
Marcio Giaxa 2018-12-24 10:27:08 -02:00
parent 682815f6e9
commit de473d4423
No known key found for this signature in database
GPG Key ID: 8628FA02F5CFEA9C
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ pub const epoch = @import("epoch.zig");
/// Sleep for the specified duration /// Sleep for the specified duration
pub fn sleep(nanoseconds: u64) void { pub fn sleep(nanoseconds: u64) void {
switch (builtin.os) { switch (builtin.os) {
Os.linux, Os.macosx, Os.ios => { Os.linux, Os.macosx, Os.ios, Os.freebsd => {
const s = nanoseconds / ns_per_s; const s = nanoseconds / ns_per_s;
const ns = nanoseconds % ns_per_s; const ns = nanoseconds % ns_per_s;
posixSleep(@intCast(u63, s), @intCast(u63, ns)); posixSleep(@intCast(u63, s), @intCast(u63, ns));