OxL Справочник OxL
РусскийEnglish

type Dur

impl Dur

С версии. 1.0.0-beta

Методы

ofNanos(n: i64) -> Dur
A duration of n microseconds.
ofMicros(n: i64) -> Dur
A duration of n microseconds.
ofMillis(n: i64) -> Dur
A duration of n minutes.
ofSeconds(n: i64) -> Dur
A duration of n seconds.
ofMinutes(n: i64) -> Dur
A duration of n minutes.
ofHours(n: i64) -> Dur
A duration of n hours.
ofDays(n: i64) -> Dur
Exactly 24 hours per day (a Period of days is calendar based, §17.2).
nanos() -> i64
Whole nanoseconds.
micros() -> i64
Whole microseconds (truncated).
millis() -> i64
Whole milliseconds (truncated).
seconds() -> i64
Whole seconds (truncated).
minutes() -> i64
Whole minutes (truncated).
hours() -> i64
Whole hours (truncated).
days() -> i64
Whole 24-hour days (truncated).
secondsF() -> f64
Fractional seconds.
isNegative() -> bool
True for a negative duration.
isZero() -> bool
True for the zero duration.
abs() -> Dur
Absolute value.
parse(text: str) -> Dur | ParseError
Parses 1h30m, 250ms, 1.5s, -5m (units ns us ms s m h d).
+(a: Dur, b: Dur) -> Dur
The sum of two durations.
-(a: Dur, b: Dur) -> Dur
The difference of two durations (may be negative).
*(a: Dur, k: i64) -> Dur
A duration multiplied by an integer.
*(k: i64, a: Dur) -> Dur
An integer multiplied by a duration.
/(a: Dur, k: i64) -> Dur
A duration divided by an integer (truncating to nanoseconds).
-(a: Dur) -> Dur
The negated duration.

Определено в: std/time/time.oxl:337

См. также