type Dur
impl DurSince. 1.0.0-beta
Methods
ofNanos | (n: i64) -> DurA duration of n microseconds. |
ofMicros | (n: i64) -> DurA duration of n microseconds. |
ofMillis | (n: i64) -> DurA duration of n minutes. |
ofSeconds | (n: i64) -> DurA duration of n seconds. |
ofMinutes | (n: i64) -> DurA duration of n minutes. |
ofHours | (n: i64) -> DurA duration of n hours. |
ofDays | (n: i64) -> DurExactly 24 hours per day (a Period of days is calendar based, §17.2). |
nanos | () -> i64Whole nanoseconds. |
micros | () -> i64Whole microseconds (truncated). |
millis | () -> i64Whole milliseconds (truncated). |
seconds | () -> i64Whole seconds (truncated). |
minutes | () -> i64Whole minutes (truncated). |
hours | () -> i64Whole hours (truncated). |
days | () -> i64Whole 24-hour days (truncated). |
secondsF | () -> f64Fractional seconds. |
isNegative | () -> boolTrue for a negative duration. |
isZero | () -> boolTrue for the zero duration. |
abs | () -> DurAbsolute value. |
parse | (text: str) -> Dur | ParseErrorParses 1h30m, 250ms, 1.5s, -5m (units ns us ms s m h d). |
+ | (a: Dur, b: Dur) -> DurThe sum of two durations. |
- | (a: Dur, b: Dur) -> DurThe difference of two durations (may be negative). |
* | (a: Dur, k: i64) -> DurA duration multiplied by an integer. |
* | (k: i64, a: Dur) -> DurAn integer multiplied by a duration. |
/ | (a: Dur, k: i64) -> DurA duration divided by an integer (truncating to nanoseconds). |
- | (a: Dur) -> DurThe negated duration. |
Defined in: std/time/time.oxl:337