Function init [src]

Create the deadline to expire after the given amount of time in nanoseconds passes. Pass in null to have the deadline call Futex.wait() and never expire.

Prototype

pub fn init(expires_in_ns: ?u64) Deadline

Parameters

expires_in_ns: ?u64

Source

pub fn init(expires_in_ns: ?u64) Deadline { var deadline: Deadline = undefined; deadline.timeout = expires_in_ns; // std.time.Timer is required to be supported for somewhat accurate reportings of error.Timeout. if (deadline.timeout != null) { deadline.started = std.time.Timer.start() catch unreachable; } return deadline; }