Import std.time.timers
Deadline
struct
Public Struct Deadline Implements Comparable, Hashable, Defaultable
A time to give up at, on the monotonic clock, as blocking calls take one; or none, which is every Deadline's zero.
Examples
Local start = Instant.FromNanoseconds(0)
Local deadline = Deadline.After(2.Seconds, start)
Expect(deadline.RemainingAt(start + 500.Milliseconds) == 1500.Milliseconds)
Expect(deadline.HasPassedAt(start + 2.Seconds) && !deadline.HasPassedAt(start))
Expect(deadline < Deadline.Never() && Deadline.Never().IsNever)-
That long after now, or after the Instant. One too far to count is none.
-
That long after
now. One too far to count is none. -
At the Instant.
-
None: it never passes.
-
None, which never passes, as Never gives.
-
Whether it's none, which never passes.
-
How long is left before it, now or at the Instant: 0 once it's passed, and the longest Duration for none.
-
How long is left before it at
now: 0 once it's passed, and the longest Duration for none. -
Whether it's passed, now or at the Instant.
-
Whether it's passed at
now. -
The earlier Deadline is the lesser; none is after every time.
-
As == goes, two Deadlines of none are the same, whatever their time.
-
A hash of its time, or 0 for none, which Deadlines that are equal share.
Report an issue with this page or with FutureBlitz on GitHub.